Answer to Question #217886 in C++ for Rosie

Question #217886
C++: By using a for loop, write a program that prints the numbers 45 to –45, in decrements of 5:
1
Expert's answer
2021-07-16T01:08:18-0400
#include <iostream>
using namespace std;
int main() {
	for(int i=45;i>=-45;i-=5){
		cout<<i<<" ";
	}
	cout<<"\n\n";
	system("pause");
	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

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS