Program to Find Whether Number entered is PRIME or NOT.

//Program to Find Whether Number entered is PRIME or NOT.


/**************************************************************/
/*Programmed by : Vivek Patel**********************************/
/*For Bugs Free feel to contact********************************/
/*Website : www.vivekpatel.cjb.net*****************************/
/*Email : vivek_patel9@rediffmail.com**************************/
/**************************************************************/

#include
#include
void main(){
int num,i;
clrscr();
printf("*****PRIME NUMBER*****\n\n");
printf("Enter the number to find it is prime or not : ");
scanf("%d",&num);
for(i=2;i if(num%i==0){
printf("\n\n%d is Not a Prime Number\n",num);
printf("It is divisible by %d, ...",i);
goto out;
}
}
printf("\n\n%d is a PRIME number",num);
out:
getch();
}



Powered by Wufoo