Thursday, June 19, 2008

Print first 10 prime numbers

To print first 10 Prime Number

Void main()
{
Int I, count=1;
For(i=1;i<=100;i++)
{
For(j=1;j<=I;j++)
{
If(j%2==0)
{
Continue;
}
If(j==i)
{
Cout<<”Number is prime”< Count=count+1;
}
If (count==10)
{
Break;
}
}

No comments: