How to make Prime number checking programm in c language

Prime Number programm

#include<stdio.h> 
#include<conio.h> 
void main() 
int i,n,r=0; 
clrscr(); 
printf(“Enter any number ”); 
scanf(“%d”,&n); 
for(i=2; i<=n; i++) 
{   
 if(n%i==0) 
r=1; 
break; 
if(r==0) 
printf(“number is prime no”); 
else 
printf(“number is Not prime”); 
getch(); 

prime number checking programm


एक टिप्पणी भेजें

0 टिप्पणियाँ