- #include<stdio.h>
- #include<conio.h>
- void main(void)
- {
- int i,k,rem;
- char ch;
- clrscr();
- while(1)
- {
- printf("enter a no");
- scanf("%d",&i);
- for (k=2;k<i;k++){
- rem=i%k;
- if(rem==0){
- printf("%d is not prime no",i);
- break;
- }}
- if (rem!=0){
- printf ("%d is a prime no",i);
- }
- printf("\n\n\tdo u wish to enter another no(y/n)?");
- ch=getche();
- if (ch=='n'){
- break;
- }
- }
- printf("\n\texiting....");
- getch();
- }
