Anda di halaman 1dari 11

Academy of Technology,Adisaptagram

Batch ALL
Introduction to
Computing(CS 201)

Question Bank

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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) 3 (c) 7 (d) none

29. How many times does the loop iterated? for(i=0;i>10;i+=2)


printf(Hi\\n) (a) 10
(b) 2
(c) 5
(d) none of
these
30. A character variable can store at a time (a) 1 character
8 characters
(c) 256 characters
none of the above

(b)
(d)

Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)

Question Bank

31. The valid integer constant is: (a) 025


$123

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

Page 5 of 11

(b) 9746

(c) 45,256 (d)

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) = =

35. If x = -5 and y = 3 then the value of x%y is (a) 2


1
(d) none of these.

(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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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]

1. Write down the difference between the following:


(a) RAM and ROM
(b) System software and application software.
(c) Primary memory and Secondary memory.
2. Briefly describe the functions of memory unit and discuss its various
parts.
3. Write down the generation wise development of the computer
hardware.
4. Write an algorithm to find the sum of the first n even numbers, where n
should be read from the user.
4. Draw a flow chart to display the first n numbers of the Fibonacci series.
The first two terms of the series are respectively 1 and 1. The nth term of
the series Fn is defined as
5. What is ternary operator?
6. What is a CPU? What is its function? Mention its several components.
7. Describe the different memory units.
8. Describe the memory hierarchy within a computer system.

Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)

Question Bank

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

Page 7 of 11

9. What is an operating system? Briefly state the role of the operating


system in a computer system.
10. Implement AND, OR, NOR, X-OR, XNOR GATES USING only NAND
gates.
11. Implement AND, OR, NAND, X-OR, XNOR GATES USING only NOR
gates.
12. What is an operating system? What is the function of an operating
system?
13. Define a flowchart. What is its use? What is an algorithm?
14. Write a suitable block diagram and briefly explain the major
components and their functions of any conventional computer.
15. State the basic features of any structured programming language.
16. What is type casting? What is automatic type conversion?
17. Explain unary operator with examples.
18. What is the purpose of a header file? Is the use of a header file
absolutely necessary? What is the return type of a programs main ()
function?
19. What is meant by a variable? What is meant by the value of a
variable?
20. Name and describe the basic data types in C. What is ASCII?
21. Describe the different types of operators that are included in C.
22. Distinguish between the following:
(a) Do - While and while loop
(b)Break and Continue
23. What is meant by associatively? Explain with an example. What is the
order of precedence and associatively of arithmetic operators?
24. What is the difference between prefix and postfix of -and ++
operators?

Academy of Technology,Adisaptagram
Batch ALL
Introduction to
Computing(CS 201)

Question Bank

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

Page 8 of 11

25. What is the difference between = and = = operators?


26. What is the difference between x++ and ++x.
27. What do you mean by unary, binary and ternary operator?
28. What do you mean by nested if? What do you mean by control
statements in C?
29. Describe the use of conditional operator to form a conditional
expression.
30. What is the purpose of the comma operator? With n which control
statement does the comma operator usually appear?
31. What will be the output for the following program segment?
i)
for(i=0; i<10; i++);
printf(\n %d, i);
ii)

int x=10;
if(x = =5);
printf(\n %d,x);

iii)

for(i=1; i<=32770; i++)


{
printf(%d,i);
}

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.

[15 Marks each]

(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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

Page 9 of 11

( ii) Primary Memory


(iii) Cache Memory.
[8+7=15]
2.

3.

4.

5.

Explain the difference between


(i) Compiler & interpreter.
(ii) Application software & system software.
(iii) Hardware & Software.
(iv) Internal Command & External Command.
(v) Dos & Windows.
X5=15]

[3

What are the different generations of computers? Briefly describe


each generation. How were computers of the second generation
different from the computers of the first generation? What is the
major change in the fourth-generation computers? What are the
various characteristics of the computers of this generation?
[2+4+3+3+3=15]
What is an operating system? What are the various categories of
operating systems ?What is the purpose of header file? What is a
variable and what is meant by the value of a variable? What are the
qualifiers that an int can have at a time? State difference between
the declaration of a variable and the definition of a symbolic name.
[2+2 +2+3+3+3=15]
(a) How are computers classified? Explain briefly. What are input
devices? Briefly explain some popular input devices. What is the
purpose of an output device? Explain various types of output
devices.
(b) For the circuit shown below draw the logic circuit using only
NAND gates.

(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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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.

Describe the different data types available in C programming


language. Describe the different types of operators that are included
in C. What is ASCII . [7+7+1=15]
Describe the use of conditional operator to form a conditional
expression. Write a program using conditional operators to
determine whether a year entered through the keyboard is a leap
year or not. Write a C program to find the GCD of two given
numbers.
[ 3+ 6+6=15]
Write a program to check whether a number is a prime or not. Write
a program to add the prime numbers of a certain range given by the
user. Distinguish between the following: (a) Do - While and while
loop. (b)Break and Continue
[5+5+5=15]
Given a number, write a program using while loop to reverse the
digits of the
number .For example, the number 12345 should be
written as 54321. Write a c program to check whether a number is a
Krishnamurthy number or not. A Krishnamurthy number is one
whose sum of factorial of digits equals the number.
[7+8=15]
11. Write a program to create following triangles
[3X5=15]
(i)
1
(ii)
1
(iii) 1
1 2 1
2 3
1 2

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

Doc No.: AOT/CS/CS201/01


Revision No.: 1.0

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)

(a) Add (11011)2 with = (1111)2


(b)Add (137) 8 with = (394)10
(c) Find the 2s complements number of (101011)2
(d) Use 1s complement to subtract (11011)2from (011901)2
(e)
Subtract
(01101)2
from
(11011)2
[1.5X5=7.5]
ii) Draw the circuit diagram for the following equations and also the
truth table

[2.5X3=7.5]

Anda mungkin juga menyukai