Incorrect
Marks for this submission: 0/1.
Question 36
Marks: 1
Does the following code pass the parameters to the function swap2 by reference? #include <iostream> using namespace std; void swap2(int a ,int b ){ int temp = a; a = b; b = temp; } int main(){ int a = 5 ,b = 7; swap2(a,b); cout << a << " " << b; return 0; }
Answer:
True
![]()
False
![]()
Incorrect
Marks for this submission: 0/1.
Question 37
Marks: 1
Find the error(s) in the following code segment. The following code should print the values 1 to 10: n = 1; while ( n < 10 )
cout << n++ << endl;
Choose one answer.
|
|
a. n = 1; while ( n <= 10 ) cout << ++n << endl;
|
|
|
|
b. n = 1; while ( n <=11 ) cout << n++ << endl; |
|
|
|
c. n = 1; while ( n < 11 ) cout << n++ << endl; |
|
Incorrect
Marks for this submission: 0/1.
Question 38
Marks: 1
An individual array element that is passed to a function and modified in that function will contain the modified value when the called function completes execution
Answer:
True
![]()
False
![]()
Incorrect
Marks for this submission: 0/1.
Question 39
Marks: 1
Which one is correct?
Choose one answer.
|
|
a. int a; a = new int(20); |
|
|
|
b. int *a; a new int[20]; |
|
|
|
c. int *a; a = new sizeof(int*20); |
|
|
|
d. int *a; a = new 20; |
|
|
|
e. int a; a = new int[20];
|
|
|
|
f. int a; a = new sizeof(int*20); |
|
Incorrect
Marks for this submission: 0/1.
Question 40
Marks: 1
What will be the results of “54 << 3"?
Choose one answer.
|
|
a. I don’t know |
|
|
|
b. 623 |
|
|
|
c. 556 |
|
|
|
d. None of these
|
|
|
|
e. 523 |
|
Correct
Marks for this submission: 1/1.
Close this window














