Question Bank CS201
Question Bank CS201
Question Bank CS201
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 1 of 11
Group - A
Choose the correct alternatives of the followings:
[1 mark each]
1. C is which kind of language?
(a) Machine (b) High level (c) Assembly (d) 5th Generation.
2. int z,x=5,y=-10,a=4,b=2;
z = x++ - --y * b / a;
What number will z in the sample code above contain?
(a) 5 (b) 6 (c) 10, (d) 11
3. int a=10,b;
b=a++ + ++a;
printf("%d,%d,%d,%d",b,a++,a,++a);
what will be the output when following code is executed
(a)12,10,11,13 ,(b) 22,10,11,13 (c) 22,11,11,11 ,(d) 22,13,13,13.
4. int x = 0;
for (x=1; x<4; x++);
printf("x=%d\n", x);
What will be printed when the sample code above is executed?
a. x=0, b. x=1, c. x=3 ,d. x=4
5. int x = 3;
if( x == 2 );
x = 0; if( x == 3 )
x++;
else
x += 2;
What value will x contain when the sample code above is executed?
a.1, b. 2 , (c).4 , (d).5
6. C Language is a case-sensitive (True / False).
7. int x = 5;
int y = 2;
char op = '*';
switch (op)
{
default : x += 1;
case '+' : x += y; /*It will go to all the cases*/
case '-' : x -= y;
}
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 2 of 11
After the sample code above has been executed, what value will the
variable x contain?
a)4, b)5, (c)6, (d).8
8. Code:
x = 3, counter = 0;
while ((x-1))
{
++counter;
x--;
}
Referring to the sample code above, what values will the variable counter
have when completed?
a)1, b).2, c)3, d)4
9. Binary operator is (a) ++, (b) ? : ,(c) +, (d) * .
10. int i = 4;
switch (i)
{
default:
;
case 3:
i += 5;
if ( i == 8)
{
i++;
if (i == 9)
break;
i *= 2;
}
i -= 4;
break;
case 8:
i += 5;
break;
}
printf("i = %d\n", i);
What will the output of the sample code above be?
(a)i = 5, b) i = 8, c)i = 9 d)i = 10.
11. Ternary operator is (a) ++, (b) sizeof ,(c) <<, (d) ? : .
12. Which of the following operator takes only integer operand ?
a) +, b) *, c)/ ,d) %
13. int x = 0;
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 3 of 11
for ( ; ; )
{
if (x++ == 4)
break;
continue;
}
printf("x=%d\n", x);
What will be printed when the sample code above is executed?
(a)x=0, (b)x=4, (c) x=5, (d) x=6 .
14. According to the Standard C specification, what are the respective
minimum sizes (in bytes) of the following three data types: short; int; and
long?
a) 1, 2, 4; (b)1, 2, 8; (c) 2, 2, 4; (d)2, 4, 8
15. int i = 4;
int x = 6;
double z; z = x / i;
printf("z=%.2f\n", z);
What will print when the sample code above is executed?
(a) z=0.00, (b) z=1.00; (c)z=1.50; (d)z=2.00 .
16. The expression 4+6/3*2-2+7%3 evaluate to
(a) 3, (b) 4, (c) 6, (d) 7.
17. Which one of the following is NOT a valid C identifier?
(a) ___S , (b) 1___ (c) ___1 , (d)S___
18. How many times the loop will execute?
int x=3456;
while(x>0){x=x/10;}
a) 3
b) infinite times
c) 4
d) 5
19. Which of the following is not valid variable declaration?
(a) int iAbc (b)int print (c) int a&b (d) int _abc
20. When applied to a variable, what does the unary "&" operator yield?
a) The variable's address b)The variable's right value
c) The variable's binary form d)The variable's value
21. short int x;
/* assume x is 16 bits in size */
What is the maximum number that can be printed using printf("%d\n", x),
assuming that x is initialized as shown above?
(a)127 , b)128, c)32,767 , d).65,536
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 4 of 11
22. Switch variable can be: (a) any data type , (b) float and char,(c)char
and int
(d) only int.
23. The break statement cause an exit : (a) only the innermost loop, (b)
only from the innermost switch, (c) from the innermost loop or switch, (d)
none of the above.
24. The library function exit () cause an exit from : (a) the loop in which it
occurs, (b) the block in which it occurs, (c) the function in which it occurs,
(d) none of the above.
If a=-11 and b= -3 what is the value of a%b? (a) 3 (b) 2 (c) 2 (d) 3.
25. A typecast is used to: (a) define a new data type (b) force a variable
to be of a particular type (c) rename an old type (d) none
26. What is the value of sum after the following program is executed?
int sum =1, index=9;
do{ index--;
sum=sum*2
} while(index>9);
(a)1
(b) 2
(c) 9
(d) 0.5
27. Consider the following program frequent :
main()
{
int a=2,b=2,c;
a=2*(b++);
c=2*(++b);
}
The correct values of a & b are: (a) 4,6
(b) 3,8
28. Write the output printf(%d,5*2/3) (a)7.5
of these
(c) 3,6
(d) 4,8
(b)
(d)
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 5 of 11
(b) 9746
32. Which is reserve word in C: (a) union (b) include (c) main (d) none of
these
33. Which of the following is allowed in a C arithmetic instruction:(a) [ ]
(b) { } (c) ( )
(d) none of these
34. Which is not a logical operator (a) &&
(b) || (c)!
(d) = =
(b) 2
(c)
36. A for loop declaration must have _____, (a) two semicolons (b) the
initialization (c) the condition (d) increment/decrement
37. Write the output printf(%d,sizeof(4.3)); -- (a) 4 (b) 8 (c) error (d)
none of these
38. A dowhile loop gets executed (a) minimum once (b) minimum zero
times (c) depends control variables (d) None of the above
39. C is a ----------- Language
(a) Procedural (b) Object oriented (c) Both (a) & (b) (d) none of these
40. A While is a (a) conditional branching statement (b) conditional
branching statement (c) Looping statement (d) None of the above
41. ------- is the high speed and the most expensive memory
(a) Cache Memory (b) RAM (c) Hard disk (d) CD-ROM
42. Operating system is a
(a) System software (b) Application software (c) Hardware (d) Firmware
43. Vacuum tubes were used in
(a) First generation Computers (b) second generation computers (c)
Third Generation computers (d) none of these
44. VLSI is
(a)Value Less System Identification (b) Very Large Scale Integration (c)
Very Large System Identification (d) None of these
45. VLSI technology was introduced in
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 6 of 11
(a) Second generation computers (b) Third Generation computers (c) 4th
generation (d) 5th generation.
46. Scanner is
(a) Input device (b) Output device (c) Software (d) None of these.
47. MS-DOS is
(a) Batch operating system (b) Multi-user operating system (c) Multitasking operating system (d) Multithreading operating system
48. RAM stands for
(a) Read Access Memory (b) Read-write Access memory (c) Random
Access Memory (d) none of these
49. ALU is a part of (a) Memory (b) CPU (c) Output device (d) Input
device.
50. Which of the following is secondary storage?
(a) Cache Memory (b) RAM (c) ROM (d) CD-ROM
Group B
[5 marks each]
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 7 of 11
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 8 of 11
int x=10;
if(x = =5);
printf(\n %d,x);
iii)
iv)
int i=10;
do
{
printf(%d,i);
i++;
}while(i>10);
v)
int i=10,a,b;
a=++i;
b=i++;
printf(%d %d %d, a, b, i);
Group-C
1.
(a)Draw the block diagram showing all the functional unit of a digital
computer. Explain the function & role of each unit in brief.
(b)Explain the following:(i) Secondary Memory
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 9 of 11
3.
4.
5.
[3
(c) For the circuit below draw the logic circuit using only NOR
gates.
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
Page 10 of 11
[(3+3+3)+3+3=15]
6.
(i)
(261)8 = ( ? )16
(ii) (131.5725)10 = ( ? )2
(iii) 2 is complement representation of (75)10
(iv)
(1101) 2 + (1111) 2 = ( ? ) 2
(v) (1101.01) 2 x (10.11) 2 = ( ? ) 2
(vi) (100 101) 2 (10011) 2 + ( ? ) 2
(vii) What is the principle of duality?
(viii)State De-Morgans law.
(ix) What is universal logic gate?
[1.5X10=15]
7.
8.
9.
10.
Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)
Question Bank
1 2 3 2 1
1 2 3 4 3 2 1
Page 11 of 11
4 5 6
7 8 9
1 2 3
1 2 3 4
(iv)
1
(v)
* * * * *
3 2 3
* * * *
5 4 3 4 5
* * *
7 6 5 4 5 6 7
* *
5 4 3 4 5
*
3 2 3
1
12. Differentiate the following:
[3X5=15]
(i) Global & local variable
(ii) While loop & do-while loop
(iii) Unary & Primary operator
(iv) break & continue
(v) A++ & ++A.
13. Convert the following
[1.5X10=15]
i)
(1101111)2 = (?)10
ii)
(1735) = (?)10
iii)
(1A2B)16 = (?)10
iv)
(183)10 = (?)8
v)
(183)10 = (?)16
vi)
(11110110111) 2 = (?)8
vii) (110111011) 2 = (?)16
viii) (2735612) 8 = (?)2
ix)
(FABC) 16 = (?)2
x)
(FA2) 16 = (?)8
14. i)
[2.5X3=7.5]