move to repo.or.cz
[letusc.git] / ch3 / examples / exa14.c
blobc7217243fb7893b9cf02d3cf018b536b000e562b
1 /*Break statements*/
3 #include<stdio.h>
5 int main()
7 int num,i;
9 i=2;
11 printf("Enter a number:");
12 scanf("%d",&num);
14 while( i<= num-1)
16 if(num%i == 0 )
18 printf("Not a prime number\n");
19 break;
21 i++;
23 if(i==num)
24 printf("This is a prime number");
26 return 0;