Engineering || Hseb notes
We provide Engineering,HSEB notes, tutorials which can be helpful for students during college life.
Pages
Home
Download Notes
Question papers
Semester Projects
Articles
About Us
Contact Us
Mero Spark (Hseb Notes) Privacy Policy
Tuesday, April 7, 2015
38. Write a program to display all prime numbers from 1 to 100.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<l00;i++);
{
for(j=2;j<i;j++)
{
if(i%j==0)
{
break;
}
if(i==j)
printf("%5d",i);
}
getch();
}
No comments:
Post a Comment
Newer Post
Next Page
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment