Ads Top

WHILE LOOP PRINTING EVEN NUMBERS USING C

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
    int a=0;
    clrscr();
    while(a<=10)
    {
    cout<<a<<endl;
    a=a+2;
    }
getch();

}

OUTPUT:

0
2
4
6
8
10

No comments:

Touchfeeds. Powered by Blogger.