Check Whether a Prime number in C Language or Not
In This Post, we will describe how to check the entered number is prime or not. Prime number in c language is the common program in c language. Prime numbers are the numbers that have only two factors, that are, 1 and the number itself. Digital Jalandhar is the Best Institute in Jalandhar. we are offering C language Coaching.
For example 1,2,3,5,7,11,15,17,19…!!!! are the Prime numbers
Algo Steps Prime number in C Language
- Enter the number from the keyboard.
- dived the entered number from 1 to till entered number.
- If the number is divisible only 2 times, then the entered number is a prime number else, not a prime number.
Let’s see the prime number in C Language. In this c program, we will get input from the user and check whether the number is prime or not.
//– prime number that number whose divide only two number
//==================like 1,3,5,7 etc…………………
printf(” ENTER THE NUMBER ::”);
printf(” ONE IS ALSO A PRIME NO.SO AGIN NEW NO.”);
printf(” the number is prime “);
printf(” not prime “);