in writing a program to print even numbers upto 100 times then, how would we start this program .?
class _____
Answers
Answered by
1
This is a C++ program
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
for (i=1;i<100;i++)
{
if (i%2==0) //to check if i is a even number
{
cout<<i<<"\n";
}
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
int i;
for (i=1;i<100;i++)
{
if (i%2==0) //to check if i is a even number
{
cout<<i<<"\n";
}
}
getch();
}
Similar questions