#include<stdio.h>
int main()
{
int number;
int count=0;
printf("Enter number to check if it is prime or not:");
scanf("%d",&number);
for(int a=1;a<=number;a++)
{
if(number%a==0)
{
count++;
}
}
if(count==2)
{
printf("\nNUMBER IS PRIME");
}
else
{
printf("\nNUMBER IS NOT PRIME");
}
return 0;
int main()
{
int number;
int count=0;
printf("Enter number to check if it is prime or not:");
scanf("%d",&number);
for(int a=1;a<=number;a++)
{
if(number%a==0)
{
count++;
}
}
if(count==2)
{
printf("\nNUMBER IS PRIME");
}
else
{
printf("\nNUMBER IS NOT PRIME");
}
return 0;
}