What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

C/C++ Lab Program(s)/Materials

PRIME NUMBER FINDING

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,c=0,j,a,b;
clrscr();
printf("Enter any number:");
scanf("%d%d",&a,&b);
for(i=a;i<=b;i++)
{
c=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
{
c++;
//printf("i=%d and j=%d and c=%d\n",i,j,c);
}
}
if(c==2)
{
printf("%d\n",i);
}
}
getch();
}

More Lab Programs with Answers -Given Below-Click and Get Freely

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com