Quiz 3 - Model - 2
Quiz 3 - Model - 2
*02*
(a) none of the above (b) not interesting
(c) greater than 10 (d) less than 5
3- What will be the output of the fragment above if the interactive user enters
the integer value 7 ?
(a) none of the above (b) not interesting
(c) greater than 10 (d) less than 5
4-What values for n will cause the output of the fragment above to be "not
interesting"?
(a)n>10 (b) n>15
(c) there is no value for n (d) n<15
5- Given the variables p, q are of char type and r, s, t are of int type. Select
the right statement?
t = (r ∗ s)/(r + s);
t = (p ∗ q)/(r + s);
a) 1 is true but 2 is false b)both 1 and 2 are true
c) 1 is false and 2 is true d) both 1 and 2 are false
6- What is the output when the following code fragment is executed?
int i = 5, j = 6, k = 7, n = 3;
cout << i + j * k - k % n << endl;
cout << i / n << endl;
(a)47 (b) 46 (c)48 (d) none of the above
2 1 3
9- Select one of the following is not valid for the variable name…
(a) Abc (b) ABC (c) _abc (d) -abc
10-What is the value stored in y (to 3 decimal places) after executing the
following lines:
double x=1, y=2, z=-3;
y = sin(x*22.0/(7*180))+tan(z);
(A)0.160 (B)-0.125 (C) 0.083 (D) None