Sunday, 7 May 2017

Program to enter any number which is prime.

Program 

#include<studio.h>
#include<condo.h>
void main ( )
{int no,i=2;
printf("\n enter any number");
scanf("%d",&no);
while(i<no)
{
if(no%i==0)
{
printf("\n not a prime number");
break;
}
i++;
}
if(i==no)
printf ("\n prime no");
}

No comments:

Post a Comment

Program to display ASCII value of any character.

Program #include<studio.h> #include<condo.h> void main( ) { char ch; clrscr(); printf("\n enter any character...