(1). What is the value ofx after this code segment? x = 20; x++; A) 20 B) 22 C)
ID: 3612394 • Letter: #
Question
(1). What is the value ofx after this code segment?
x = 20;
x++;
A) 20
B) 22
C) 23
D) 21
(2). What is the value ofthe x after this code segment?
x = 20;
++x;
A) 20
B) 22
C) 23
D) 21
(3). What is the value of(a++ +5) after this code segment?
A) 5
B) 9
C) 10
D) 8
This applies to #3 and #4
Given
/* Example of postfix/prefix increment and decrement. */
#include<iostream.h>
int main (void)
{
// Local Declaratons
int a;
// Statements
a=4;
cout << "Value ofa++ +5" <<(a++ +5 <<endl;
cout<< endl
return 0;
//main
}
(4). What is the value of(++a +5) after this code segment?
A) 5
B) 9
C) 10
D) 8
Explanation / Answer
Dear... 1) x = 20; x++; the value of x afterexecution is 212)x = 20;
++x; the value of x after execution is21 3) The value after executionof (a++ +5) is 9 4) The value after executionof (++a +5) is 10 Hope this will helpyou...
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.