hi friends
this small compact code is for printing any number of prime numbers in C Language, you just have to change the last line's 500 to any number you want,
here some points necessary to understand the code are as follows-
1.> variable torf stands for true or false,in case if number is prime(true condition), torf's value is 1, else it is zero.
2.> here i have used for loop for simplicity, you can modify this if you lOVE TO HANDLE complications. :cool:
for any other help, regarding computing, feel free to contact-
<<snip>>
SHUBHAM GORE, B.tech (1st YEAR)
IIIT- JABALPUR,
M.P.
#include<stdio.h>
void main()
{
int i=2,j,torf;
shubhamgore_08109075922_india:
torf=1;
for(j=2;j<i;j++) if(i%j==0) torf=0;
if(torf==1) printf("\n\t %d is a Prime number",i);
i++;
if(i<500) goto shubhamgore_8109075922_india;
}