Answer to Question #260586 in C++ for vinno

Question #260586

1.     Write a C++ statement that updates the value of newNum variable by adding the value of the named variable SECRET (assign any value to this variable). Then, write a C++ statement that outputs the value of newNum with an appropriate message.


1
Expert's answer
2021-11-03T04:22:27-0400
#include <iostream> 

using namespace std; 

int main(){ 
	const int SECRET =8;
	int newNum=2;
	newNum+=SECRET;
	cout<<"newNum: "<<newNum<<"\n";
	cin>>newNum;
	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