Program to find a number is Prime Or Not

#include<conio.h>

#include<stdio.h>

void main()

{

int i,n,c;

clrscr();

printf("Enter the value of N");

scanf("%d",&n);

for(i=2;i<n;i++)

{

c=n%i;

if(c==0)\

{

printf("N is not a prime Number");

}

if(c!=0)

{

printf("N is a prime number");

}

getch();

}

Output

Enter the value of N=29

prime number

Enter the value of N=75

N is not a prime number

Comments

Popular posts from this blog

Gove confirms mandatory housebuilding targets for councils will be abolished in face of Tory rebellion – UK politics live

Kotak Mahindra Bank Recruitment 2022 Released for Graduate Candidates And Apply Online