You are on page 1of 3


TECH (NEW)/SEM-2/CS-201/2014
[Time Allotted: 3 Hours] [Full Marks: 70]
(Multiple Choice Type Questions)
1. Choose the correct alternative of the following: 10 X 1 = 10

i) The conversion of (FAFAFA)16 into octal form is
a) 76767676
b) 76575372
c) 76737672
d) 76727672

ii) Which is the range of unsigned short integer?
a) 0 to 65535
b) 0 to 255
c) -128 to 127
d) none of these.

iii) Pointer is
a) a variable containing the address of a variable
b) a value
c) a memory location
d) none of these

iv) Which will be the output?
void main()
int x=7, y=5;
x=y++ + x++;
y=++y + ++x;
printf(“%d%d”, x, y);
a) 12 20
b) 13 20
c) 14 20
d) 14 21

v) A function may contain
a) one return statement
b) two return statements
c) more than two return statements
d) none of these

vi) Which one of the following is a Bitwise operator?
a) <
b) >=
c) &&
d) <<

vii) Members of a union use
a) different storage locations
b) same storage location
c) no storage location
d) none of these

viii) The purpose of mode r+ is to
a) open for only reading
b) open for only writing
c) open for both reading and writing
d) none of these.

ix) Which one is the correct output?
char a[ ]=”computer”;
printf(“%d”, strlen(a));
a) 8
b) 9
c) 10
d) 11

x) int i=5, j=6, k; printf(“%d”, i-- + ++j);
The output will be
a) 10
b) 11
c) 12
d) 13
(Short Answer Types Questions)
Answer any three of the following. 3 X 5 = 15

2. Describe the functions of various units of a digital computer using a neat block diagram. [5]
3. Write a C program to arrange a set of n numbers in ascending order. [5]
4. Draw a flowchart to find the largest among three numbers taken as input. [5]
5. (a) What are the differences between recursion and iterations?
(b) Write a recursive C function to generate Fibonacci series. [2+3]
6. Write a C program to print the following pattern: [5]
(Long answer Type Questions)
Answer any three of the following. 3 X 15 = 45
7. a) What is an operating system? Write down the basic operations of an operating system?
b) Convert the following:
i) (2AD5)16= ( )8 ii) (11100111101)2 = ( )16 iii) (30.125)10 = ( )2 iv) (3054)8 = ( )16
c) Simplify: (A+B

).(A.C)+ (A.B

+ A

.C).(A +D
d) Find out the result of following subtraction using 2’s complement and justify the result:
i) (15)10-(9)10
ii) (1110)2-(10100)2
8. a) What is a function? What are the advantages of using functions? What is the purpose of the return
b) Write a complete C program to print prime numbers upto a given range.
c) Differentiate among auto, static, extern and register variable with suitable example.
d) Differentiate between ‘break’ and ‘continue’ statements with suitable example.

9. a) What is a loop? Distinguish between while and do-while loop with an example.
b) Write a recursive C-function to find out the GCD of two numbers.
c) Give the expression to swap the content of two numbers using ternary operator.
d) Write a complete C program to print the Pascal triangle:
1 1
1 2 1
1 3 3 1
1 4 6 4 1
10. a) What is a two-dimensional array? What is subscripted variable?
b) “C does no support bound checking”-Explain.
c) Write a complete C program to determine the transpose of a 2D matrix and display the resultant
d) What is a string? Write a complete C program to check whether a string taken as input is
palindrome or not without using any string function.
11. a) Explain the difference between call by value and call by reference with an example.
b) Explain the use of malloc( ) and calloc( ) function with suitable example.
c) What is structure in C? How it is different from union?
d) Declare a structure called student that will describe the following information:
Roll No
Total Marks
Using student declare an array result with 20 elements and write a C program to read the
information of all the 20 students and print the Name and Roll No of the scoring highest marks.