Program to find prime number in C.
Prime number : A prime number is a number whose only factors are 1 and itself. That means there is no whole number that evenly divides the prime number.
Let’s write a program to find prime number in C.
Step 1: Let’s open turbo c/c++ and write the following code:
long int i,n,c=0;
printf(“enter any number : ”);
//Assign value in variable n
printf(“this is prime number”);
printf(“this is not a prime number “);
Step 2: Now save it by pressing F2 and name it prime.cpp.
Step 3: After save it ,Compile it by pressing ALT+F9 to check errors and correct them.
Step 4: Now run the program by click on Run or by pressing ALT+R and see the output .