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