Answer to Question #346540 in C++ for Ghulam Nabi

Question #346540

Write a Program that generates the following output:

10

20

19

Use an Integer constant for the 10, an arithmetic assignment operator to generate

the 20, and a decrement operator to generate the 19.


1
Expert's answer
2022-05-31T10:03:44-0400
#include <iostream>
int main()
{
	const int C = 10;
	int A = C * 2;
	int B = A;
	--B;
	std::cout << C << "\n";
	std::cout << A << "\n";
	std::cout << B << "\n";
}

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