I need a program to generate Prime Numbers b/w Two Limits.
It should be programed by using Turbo C 3.0.
other wise i will give u -ve marks.
"Prime Number Generating Program" b/w "Two Limits" Using "Turbo C 3.0"?
#include %26lt;stdio.h%26gt;
int main(void)
{
int n,i=1,j,c;
clrscr();
printf("Enter Number Of Terms
");
printf("Prime Numbers Are Following
");
scanf("%d",%26amp;n);
while(i%26lt;=n)
{
c=0;
for(j=1;j%26lt;=i;j++)
{
if(i%j==0)
c++;
}
if(c==2)
printf("%d ",i)
i++;
}
getch();
}
hibiscus
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment