Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int n, i, j, count = 0;
- scanf("%d", &n);
- for(i = n; i >= 1; i--){
- for(j = n-1; j >= sqrt(n); j--){
- if(n % j == 0) count++;
- }
- if(count == 0) {
- printf("%d\n", i);
- break;
- }
- else n = n- 1;
- count = 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement