Answer to Question #53182 in C++ for Mohdhaneef

Question #53182
Write a program that generates the following outputs :
5
10
9
Assign value 5 to a variable using= multiply it with 2 to generate 10 and subtract 1 to generate 9
1
Expert's answer
2015-07-01T06:51:26-0400
#include iostream;
using namespace std;
int main() {
int a = 5;
cout<<a;
a *= 2;
cout<<a;
a-=1;
cout<<a;
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
APPROVED BY CLIENTS