0 Comments

Prime Number : A number that can be divided exactly only by itself and 1. such as 7, 11, 23 etc

//C Program for Prime Number

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

int n, m, i, c=0;

printf("Enter a Number\n");

scanf("%d",&n);

m=n/2;

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

{

if(n%i==0)

{

printf("%d is not a prime number",n);

c++;

break;

}

}

if(c==0)

{

printf("%d is a Primne number",n);

}

getch();

}

YouTube Video

(Please Subscribe our Channel)

Leave a Reply

Your email address will not be published. Required fields are marked *