CS201 · Midterm#20
Consider the following code segment. What will be the output of following code?
Int addValue (int *a){
int b = (*a) + 2;
return b ;
}
main () {
int x =6 ;
cout << x << “,†;
cout << addValue(&x) << “,†;
cout << x ;
}
Show correct answer
Correct answer: A. 6,8,6
Check community answers against your course notes.