Program to generate a series of first 50 even numbers using while loop

program to generate a series of first 50 even numbers using while loop

Write a program to generate a series of first 50 even numbers using while loop.

 

Object: Write a program to generate a series of first 50 even numbers using while loop.

Code:

#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int i=0;
while(i<100)
{
if(i%2==0)
{
cout<<i<<“,”;
}
i++;
}
getch();

}

Output:

Program to generate a series of first 50 even numbers using while loop

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *