Write a C++ program to print all even numbers between 1 to 100. - using while loop
#include <iostream>
#include <fstream>
using namespace std;
int main() {
int num = 1;
while(num < 100){
if(num%2 == 0){
cout << num << "\n";
}
num++;
}
}
Comments
Leave a comment