CS101 Midterm 2016
CS101 Midterm 2016
Questions
MCQ# MCQ#
1 a b c d 21 a b c d
2 a b c d 22 a b c d
3 a b c d 23 a b c d
4 a b c d 24 a b c d
5 a b c d 25 a b c d
6 a b c d 26 a b c d
7 a b c d 27 a b c d
8 a b c d 28 a b c d
9 a b c d 29 a b c d
10 a b c d 30 a b c d
11 a b c d 31 a b c d
12 a b c d 32 a b c d
13 a b c d 33 a b c d
14 a b c d 34 a b c d
15 a b c d 35 a b c d
16 a b c d 36 a b c d
17 a b c d 37 a b c d
18 a b c d 38 a b c d
19 a b c d 39 a b c d
20 a b c d 40 a b c d
Sample a b c d Sample a b c d
a) 0 (there is an error)
b) infinite (there are no statements in the for loop)
c) 10 times
d) 9 times
Question 11: What is printed on the screen after the following piece of C/C++ is executed?
int a, b, x;
a = 15; b = 10;
x = a / b;
if (x != 0)
x--;
else
x++;
cout<<x;
a) 2
b) 2.5
c) 0
d) 0.5
Question 12: What is printed on the screen after the following piece of C/C++ is executed?
int a, b, x;
a = 12; b = 6;
x = a % b;
if (x == 2)
x -= 2;
else
x += 2;
cout<<x;
a) 2
b) -2
c) 0
d) 4
Question 25: Which of the following operators has the highest precedence?
! (Logical Not), + (Addition), * (Multiplication), && (Logical
And)
a) &&
b) +
c) *
d) !
Question 28: What values of a, b, c will make the following expression false.
b || !c && d
a) b=-1, c=0, d=1
b) b=1, c=1, d=0
c) b=0, c=0, d=1
d) b=0, c=1, d=1
Question 29: What are the values of a and b computed by the following code?
int a=3, b=5;
a*=b++;
a) a=18, b=5
b) a=18, b=6
Question 30: What are the values of a and b computed by the following code?
int a=3, b=5;
a*=++b;
a) a=18, b=5
b) a=18, b=6
c) a=15, b=5
d) a=15, b=6
Question 35: How many times does the following loop executes?
int x=-5;
while (x<5);
x++;
a) 0 (there is an error)
b) infinite (there are no statements in the loop)
c) 10 times
Question 36: How many times will the following while loop run?
int x=0,y=1;
while(x<100)
{
x+=y*y;
y+=x*x;
}
a) 0
b) 1
c) 2
d) 3
Question 38: The component of the central processing unit that performs logical operations, stores data
and keeps results during the processing is called the:
a) Arithmetic/Logic unit.
b) Control unit
c) Main memory
d) Micro processing chip
Question 40: Applications talk to devices through the OS and the part of the OS that manages devices is
called the ________________________.
a) File System
b) Application Interface
c) Kernel
d) Device Driver
[a] 1 3
0 3
[b] 2 3
1 4
[c] 2 4
1 5
[d] Compilation error
Question: When the Operating System (OS) is first started, control is first transferred to ______________
which uses a small program called _______________ to load the OS from the Hard Disk
a) RAM, Kernel
b) Processor, Windows
c) Hard Disk, Kernel
d) ROM (or BIOS), BootStrap (or Bootloader)