Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Please do not
Detached this
Sheet
CS101, Introduction to Computing and Programming
Fall 2015, Mid Term Examination
Total Marks = 40
Max. Time 60 minutes
Name:
______________________________
MCQ#
1
2
3
4
5
a
a
a
a
a
b
b
b
b
b
c
c
c
c
c
Questions
MCQ#
d
21
d
22
d
23
d
24
d
25
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Sample
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Sample
1
a
a
a
a
a
b
b
b
b
b
c
c
c
c
c
d
d
d
d
d
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
For the following problems, assume that preprocessor directives/header files have already
been included at the start of the program, and the given code is part of the main() function.
1. The .houses all essential chips and provides connecting circuitry
between them.
a) CPU
b)
Motherboard
c) Hard Drive
d)
Computer Casing
2. When a read-write head runs into a dust particle or other contaminant on the disk, it is
called as
a) Head Crash
b)
Head Damage
c) Jarring
d)
None of the above
3. Which of the following service is provided by Operating System?
a)
c)
Memory Management
Both (a) and (b)
b)
d)
File Management
None of the above
4. When a computer is powered on, BIOS first loads a very small program, placed in the
very first location of the hard-disk, into RAM and the processors starts running it. This is
called a program.
a)
c)
Bootstrap
Kernel
b)
d)
POSTs
Firmware
a)
c)
3
3 5
b)
d)
5
Syntax Error
C++ is awesome
b)
c)
C++ is headache
d)
C++ is awesome
C++ is headache
No Output/Blank Screen
b)
d)
2
3
1
0
4
0
b)
d)
2
3
b)
C++ is easy
d)
Hello World
Welcome World
Thank you World
Bye World
b)
Hello World
Bye World
Welcome World
Bye World
d)
b)
d)
1
2
b)
d)
0
3
5.0
4
b)
d)
4.0
4.75
00
10
b)
d)
01
11
00
11
b)
d)
01
Syntax error
a)
c)
00
10
b)
d)
01
11
2.5
3.0
b)
d)
3
2.0
50 45 40 35 30 25 20 15 10 5
50 45 40 35 30 25 20 15 10 5 0
45 40 35 30 25 20 15 10 5 0
5 10 15 20 25 30 35 40 45 50
( 1 , 1 , 1 );
( 1 , 1 , 1 );
( 1 , 1 , 1 );
( 1 , 1 , 1 );
( 2 , 3 , 3 );
( 2 , 3 , 3 );
( 2 , 3 , 3 );
( 2 , 3 , 3 );
( 3 , 6 , 6 );
( 3 , 6 , 6 );
( 3 , 6 , 6 );
( 3 , 6 , 6 );
( 4 , 10 , 0 );
( 4 , 10 , 0 );
( 4 , 10 , 0 );
( 4 , 10 , 0 );
( 6 , 16 , 6 );
( 5 , 15 , 5 ); ( 6 , 16 , 6 );
( 5 , 15 , 5 );
( 5 , 15 , 5 ); ( 6 , 21 , 1 );
1 3 5 7 9
Logical error/Infinite loop
b)
d)
2 4 6 8 10
Syntax error
5
15
b)
d)
10
20
0,0
3,4
b)
d)
2,3
4,3
0
9
b)
d)
10
11
2 3 4 5
4 5
b)
d)
3 4 5
5
10
1
0
Error
Invalid
1
b)
d)
10
0
0.0
Invalid
b)
d)
1.0
Syntax Error
a)
c)
value of a: 20
value of a: 15
b)
d)
value of a: 10
value of a: 19
123456
654321
b)
d)
22222
011223
33. Which looping process (es) waits till the end of the loop to check the test condition?
(i) for
(ii) while
(iii) do-while
(iv) if-else
a)
c)
b)
d)
34. What will be the output of the following if abs(i) gives the positive value of i.
(e.g. abs(-2) = 2)?
int n=3;
int i= -1*n;
do
{
int j=-1*n;
do{
if(abs(i)==abs(j))
cout<<"*";
else
cout<<" ";
j++;
}while (j<=n);
i++;
cout<<"\n";
}
while(i<=n);
10
a)
b)
c)
d)
0.1
0.1 0.2 0.3 0.4 0.5
b)
d)
1.1
1.5
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
02468
b)
0 2 4 6 8 10 12 14 16 18 20
d)
0 2 4 6 8 10
2323
2233
b)
d)
3344
3322
a)
c)
5432
54321
b)
d)
531
12345
-127 to +127
1
b)
d)
0 to 127
Infinite loop condition
0.05
-0.05
b)
d)
1.50
1.50
12