How to write a C or C++ program to print prime number in C Programming Language ?
This Program print first 50 prime number.
To print first 50 prime number
Solution For C Program:#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
main()
{
int i,num=1;
//clrscr();
while(num<=100)
{ i=2; while(i<=num)
{ if(num%i==0)
break;
i++; }
if(i==num)
printf("\n%d is Prime",num);
num++;
}
getch();
}