C program to check whether inputted number is prime number or not.

Prime numbers are divisible only by 1 and by themselves. 2,3,5,7,11 etc are prime numbers. These numbers are only divisible by 1 and by themselves. To check whether a given number is prime number or not, at first, we start a loop from 1 to given number and check as if it is divisible the loop incremented number and if it is, then we will print that given number is prime number and also if it is 2, we will directly check it and print that given number is prime number. Have a look here,





The Output





Comments

Popular posts from this blog

C program to display prime numbers between 1 to 100.

Progarm to state that a person can cast vote or not. [Note: A person can cast vote if he is 18 years old or above]

ChatGPT on smartwatches