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.
#include <iostream>
using namespace std;
int main(){
const int SECRET =8;
int newNum=2;
newNum+=SECRET;
cout<<"newNum: "<<newNum<<"\n";
cin>>newNum;
return 0;
}
Comments
Leave a comment