Answer to Question #286523 in C++ for nikki

Question #286523
create a program that will accept 1 input number then display the even numbers base from the inputted number




1
Expert's answer
2022-01-11T11:06:35-0500
#include <iostream>


using namespace std;








int main() {
	
	int number;
	cout<<"Enter number: ";
	cin>>number;
	cout<<"\nAll the even numbers:\n";
	for(int i=0;i<=number;i++){
		if(i%2==0){
			cout<<i<<"\n";
		}
	}




	cin>>number;


	return 0;
}

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