Do-While Program in C/C++ to print all even numbers from 1-50

Do-While Program in C/C++ to print all even numbers from 1-50


This is a Do-While Program in C/C++ to print all even numbers from 1-50.


#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
int main()
{
int num=0;
do{
cout << num << "\t";
num=num+2;
}
while(num<=50);
}

Comments

Popular posts from this blog

Classes in OOP (Object Oriented Programming)

A small airline has just purchased a computer for its new automated reservations system. You’ve been asked to program the new system. You are to write a program to assign seats on each flight of the air line’s only plane (capacity: 10 seats).