Answer to Question #321380 in C++ for Micheal

Question #321380

Write a C++ program to print all even numbers between 1 to 100. - using while loop


1
Expert's answer
2022-06-21T08:39:35-0400
#include <iostream>
#include <fstream>
using namespace std;

int main() {
	int num = 1;
	while(num < 100){
	    if(num%2 == 0){
	        cout << num << "\n";
	    }
	    num++;
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog