Thursday, 11 July 2013

Continue

Find even numbers with continue...

#include<iostream.h>
#include<conio.h>
void main()
{
    int n;
    clrscr();
    for(n=0;n<=10;n++)
    {
        cout<<"n= "<<n<<"\n";
        if(n%2==1)
            continue;
        else
            cout<<"This is even \n";
    }
getch();
}

 

Here is the output :)


No comments:

Post a Comment