Advertisement
LeTuanAnh

Untitled

Oct 5th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>  
  2. #include<conio.h>
  3. int main()
  4. {
  5.     int n, i;
  6.     printf("nhap vao n:");
  7.     scanf("%d", &n);
  8.     if (n < 2) {
  9.         printf("%d khong la so nguyen to", n);
  10.     }
  11.     else {
  12.         printf("%d la so nguyen to", n);
  13.         for (i = 2; i < n; i++){
  14.             if (n%i == 0)
  15.             {
  16.                 printf("%d khong la so nguyen to", n);
  17.                 break;
  18.             }
  19.         }
  20.     }
  21.     getch();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement