
- Forum
- Programming Talk
- C and C++
- Print Prime numbers
Print Prime numbers
This is a discussion on Print Prime numbers within the C and C++ forums, part of the Programming Talk category; HI, Want help in writing a program in C. :Print first 25 prime numbers....
-
Print Prime numbers
HI,
Want help in writing a program in C. :Print first 25 prime numbers.
-
here is the answer
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int a,c=0;
printf(" First fifteen prime numbers\n");
printf("2 \n3\n5\n7\n");
for (a=8;a<99;a++)
{if ((a%2!=0)&&(a%3!=0)&&(a%5!=0)&&(a%7!=0))
printf("%d\n",a);
}
system ("PAUSE");
return 0;
}
«
how to make the password in to asterisk and asign a exact password for char.
|
c program to calculate salary
»

Reply With Quote






