4. Using cin, Allocating Memory, and Writing Assignment Statements cin, Memory A
ID: 3888564 • Letter: 4
Question
4.Using cin, Allocating Memory, and Writing Assignment Statements
cin, Memory Allocation, and Assignment Statements
Show the variable name and value of each statement
1.int a, b = 9;
a = b;
2.int d = 2, x = 3, y = 1;
y + 4 = d - x;
3.short number = 10;
number = 0;
4.short number = 0;
number = 10;
number = number + 5;
5.double value = 12.0;
value = 10.0;
value = value + .5;
6.const int b = 9;
7.double x = -14.5, y = 22.5;
int d = 3;
y = d - x + y;
8.double ans = 4;
9.int n;
cin >> n;
//Assume the user enters 3.24.
10.char a;
cin >> a;
Assume the user enters ‘b’.
cin, Memory Allocation, and Assignment Statements
Show the variable name and value of each statement
1.int a, b = 9;
a = b;
2.int d = 2, x = 3, y = 1;
y + 4 = d - x;
3.short number = 10;
number = 0;
4.short number = 0;
number = 10;
number = number + 5;
5.double value = 12.0;
value = 10.0;
value = value + .5;
6.const int b = 9;
7.double x = -14.5, y = 22.5;
int d = 3;
y = d - x + y;
8.double ans = 4;
9.int n;
cin >> n;
//Assume the user enters 3.24.
10.char a;
cin >> a;
Assume the user enters ‘b’.
Explanation / Answer
Note : Could u please check the results..If u want me to do any modifications.I will do it.Thank You
_______________
1.int a, b = 9;
a = b;
a=9
2.int d = 2, x = 3, y = 1;
y + 4 = d - x;
Invalid left hand side must be one variable
3.short number = 10;
number = 0;
number=0
4.short number = 0;
number = 10;
number = number + 5;
number =10
number =15
5.double value = 12.0;
value = 10.0;
value = value + .5;
value=10.0
value = 10.5
6.const int b = 9;
b=9
7.double x = -14.5, y = 22.5;
int d = 3;
y = d - x + y;
y = 3-(-14.5)+22.5;
y = 3+14.5+22.5;
y = 40
8.double ans = 4;
Ans = 4
9.int n;
cin >> n;
//Assume the user enters 3.24.
n=3
10.char a;
cin >> a;
Assume the user enters ‘b’.
a = b (The variable a contains the value ‘b’)
___________________Thank You
1.int a, b = 9;
a = b;
a=9
2.int d = 2, x = 3, y = 1;
y + 4 = d - x;
Invalid left hand side must be one variable
3.short number = 10;
number = 0;
number=0
4.short number = 0;
number = 10;
number = number + 5;
number =10
number =15
5.double value = 12.0;
value = 10.0;
value = value + .5;
value=10.0
value = 10.5
6.const int b = 9;
b=9
7.double x = -14.5, y = 22.5;
int d = 3;
y = d - x + y;
y = 3-(-14.5)+22.5;
y = 3+14.5+22.5;
y = 40
8.double ans = 4;
Ans = 4
9.int n;
cin >> n;
//Assume the user enters 3.24.
n=3
10.char a;
cin >> a;
Assume the user enters ‘b’.
a = b (The variable a contains the value ‘b’)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.