Advertisement
shohan11421

Untitled

Jan 9th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5.     int n, i, j, count = 0;
  6.     scanf("%d", &n);
  7.     for(i = n; i >= 1; i--){
  8.         for(j = n-1; j >= sqrt(n); j--){
  9.             if(n % j == 0) count++;
  10.         }
  11.         if(count == 0) {
  12.                 printf("%d\n", i);
  13.         break;
  14.         }
  15.         else n = n- 1;
  16.         count = 0;
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement