C Program to print prime numbers between n1 and n2 where n1 and n2 are user inputs
#include
#include
void main()
{
int n1,n2,i,j;
clrscr();
printf("\nEnter the numbers:");
scanf("%d%d",&n1,&n2);
printf("\nPrime Numbers:");
for(i=n1;i<=n2;i++)
{
for(j=2;i<=i;j++)
{
if(i%j==0)
break;
}
if(j==i)
printf("\n%d",i);
}
getch();
}
***********OUTPUT**************
Enter the numbers:1
10
Prime Numbers:
2
3
5
7
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Wednesday, December 31, 2008
C Program to print prime numbers between n1 and n2 where n1 and n2 are user inputs
Posted by ars at 11:54 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment