Вы находитесь на странице: 1из 6

University of Calcutta

CBCS sample questions


Electronics(H) Paper CC4
Sample questions are for illustrative purposes only. Questions of similar type and complexity
may be set in the examination.

Sl No Questions Marks
1 What are logical operators? 1
2 Write the functionality of ‘void main( )’. 1
3 How are a negative integers stored in memory? 1
4 What is a queue data-structure? 1
5 What is the difference between ‘int’ and ‘unsigned int’ data types in 1
C?
6 What is the use of the preprocessor directive ‘#define’ in C? 1
7 Define ‘sibling’ node in a tree data-structure. 1
8 What is the role of ‘push()’ and ‘pop()’ functions in an array- 1
implementation of a stack?
9 a=5; b = a++ + ++a; What would the value of b be? 1
10 Write one difference between binary and non-binary tree. 1
11 What is meant by ‘token’ in C-language? 1
12 What does the preprocessor directive: ‘#include<conio.h>’ 1
accomplish ?
13 What is the use of ‘getch( )’ function in C?. 1
14 What is a ‘pointer’ in C ? 1
15 Differentiate between an array and an ordinary variable. 2
16 Which type of linked list comprises the adjacently placed first and 1
the last elements?
a. Singly Linked List b. Doubly Linked List
c. Circular Linked List d. All of the above
17 The declaration float a, b; reserves ______of memory for the 1
variables a & b.
[A] 1 byte [B] 4 bytes [C] 8 bytes [D] 16 bytes
18 Which of the following is not a relational operator? 1
[A] ! [ B] != [C] >= [D] <
19 Which of the following is an operator in C? 1
[A] , [B] $ [C] @ [D] None of these
20 Which among the following represents an unconditional loop in C? 1
[A] do-while [B] while [C] goto [D] for
21 C programming language was developed by: 1
[A] Dennis Ritchie [B] Ken Thompson [C] Bill Gates [D]
Peter Norton
22 C was developed in the year: 1
[A] 1970 [B] 1972 [C] 1976 [D] 1980
23 The maximum length of a variable of type ‘double’ in C is : 1
[A] 8 bits [B] 16 bits [C] 32 bits [D] 64 bits
24 The operator ‘&’ represents: 1
A] Bitwise AND [B] Bitwise OR [C] Logical AND [D]
Logical OR
25 Which of the following operators has the highest priority among 1
themselves?
[A] ++ [B] % [C] + [D] ||
26 Which header file must you include in your C program to make use 1
of the malloc() function?
[A] stdio.h [B] stdlib.h [C] conio.h [D] mem.h
27 An array ‘a’ is declared as: int a[8][6] . What is the number of 1
elements of the array ‘a’?
[A ] 2 [B] 14 [C] 48 [D] 86
28 In a linked list, each node contain minimum of two fields. One field 1
is ‘data-field’ to store the data. The second field is:
a) Pointer to character
b) Pointer to integer
c) Pointer to node
d) Node
29 Linked list is considered as an example of ___________ type of 1
memory allocation.
a) Dynamic
b) Static
c) Compile time
d) None of the mentioned
30 What is the need for a circular queue? 1
a) effective usage of memory
b) easier computations
c) all of the mentioned
d) none of the mentioned
31 Disadvantage of using array representation for binary trees is? 1
a) difficulty in knowing children nodes of a node
b) difficult in finding the parent of a node
c) have to know the maximum number of nodes possible before
creation of trees
d) difficult to implement
32 If you want to store dissimilar types of data together in C, then you 1
need to use:
a. array
b. structure
c. stack
d. None of the above.
33 int main() 1
{

int a=1, b=3;


printf ("%d",a&b);
return 0;
}

The output of the above C program would be:


a. 1
b. 2
c. 3
d. None of the above.
34 An array ‘a’ is declared as: int a[3] ={2, -3, 5}; 1

Which of the following is true?


a. a[0] = 2, a[1] = -3, a[2] = 5.
b . a[1] = 2, a[2] = -3, a[3] = 5.
c . Both of a and b
d . Neither of a or b.
35 Quick sort running time depends on the selection of 1

a. size of array
b. pivot element
c. sequence of values
d. none of the above!
36 A complete graph can have 1

a . n2 spanning trees
b. nn - 2 spanning trees
c. nn + 1 spanning trees
d. nn spanning trees
37 What should be the value of rear (end) if the queue is full (elements 1
are completely occupied)?
a. 1
b. - 1
c. MAX + 1
d. MAX - 1
e. zero (null)
38 Which linear structure has a provision of Last-In-First-Out (LIFO) 1
mechanism for its elements?

a. Stack
b. Queue
c. Both a & b
d. None of the above
39 What should be the growing direction of two stacks while 1
implementing them in a similar array so as to reduce the overflow
chances?
a. Forward
b. Backward
c. Opposite
d. None of the above
40 Which expressions are also regarded as ‘Reverse Polish Notations’ 1
a. Prefix
b. Postfix
c. Infix
d. All of the above
41 Which of the following techniques represents the precise sequence 1
of an ‘In-Order Traversal’ of a Binary Tree?
a. Visit the Root, Traverse Left Subtree, Traverse Right Subtree
b. Traverse Left Subtree, Visit the Root, Traverse Right Subtree
c. Traverse Left Subtree, Traverse Right Subtree, Visit the Root
d. None of the Above
42 Which balance factor is stored in the new field introduced by an 1
AVL tree for the representation of a node?

a. Length
b. Height
c. Width
d. Information
43 What is meant by ‘Syntax Error’? 2
44 What is a global variable in C? 2
45 What is a nested loop? 2
46 What is the use of strlen() function in C or C++? 2
47 What are arithmetic operators? Name a few arithmetic operators. 2
48 Explain with examples the difference between ++i and i++ in C. 3
49 Illustrate with an example the use of ‘switch’ statement in C. 3
50 What are priority queues? 2
51 What is a linked list? 2
52 What is a node? Write the syntax for node creation in C or C++. 1+2+1
Write the syntax for pointing to the next node in C or C++.
53 What is the difference between a Stack and an Array? 2
54. What are the disadvantages of array implementation of a linked list? 3
55 What is quicksort algorithm? 5
56 a.Write two disadvantages of C-language. 1+(1+2)+2+4
b. What are dentifiers in C? How can you check if a string is an
identifier or not?
c. Find the identifiers in the following C-program:
void main()
{
int a123 = 25;
char b_1;
}
d. Write a program in C to multiply and divide two integers and
produce a result up to eight digits (integers) in case of multiplication
and three decimal digits in case of division.
57 a. Explain with an example what is meant by ‘Mixed mode (1+1)+4+4
arithmetic expression’?
b. Write the meaning of the following operators: %, <=, ||, /=, &=,
++, ?:, sizeof( ).
c. Write a program in C which can store an array of length 10, the
elements of the array being read from the user and display the array-
elements in reverse sequence.
58 a. What is meant by object oriented programming? 1+(2+2+1)
b. Explain in brief the terms:Polymorphism, Inheritance, and +1+2+1
Encapsulation.
c. How can you create a structure in C?
d. What is a ‘nested structure’? Give a suitable example.
e. What is the advantage of using ‘typedef’ with a Structure?
59 a. Write the difference between the ‘for’ loop and ‘while’ loop (1+2+2)+
constructs in C. Also write two programs in C to print (1+1)+3
the prime numbers from 1 to 100 using the above two different loop
constructs.
b. What is a standard library function? Give an example.
c. Write a function in C which can return the maximum of two real
numbers.
60 a. Write a C program in C or C++ to sort the integers: 16 50 37 56 3+3+2+2
47 85 30 9 in ascending order using merge-sort algorithm.
b. Write a C or C++ proram to perform the same sorting as above
using the bubble sort algorithm.
c. Compare the worst-case time complexity for the two sorting
algorithms stated above.
d. What is insertion sort.
61 a. Define binary tree and binary search tree (BST). Differentiate (2+2)+3+3
between them.
b. Write down the different traversal processes in a BST.
c.Write the order of the different types of traversal in the tree below:

62 a. Convert the following infix expression to prefix and postfix (2+2)+2+


expression: 1+(1+2)
(A+B)*(C-(D – E)+(F+G))/(H+I)
b. Write four differences between a stack and a queue.
d. What is a circular queue?
e. What is a linked list? Differentiate between a circular linked list
and a doubly linked list.
63 What is an operator? Explain the arithmetic, relational, logical, and 2+(2+2+2+2)
assignment operators in C with examples.
64 Explain the ‘switch statement’ with syntax and example. Explain 4+(2+2+2)
the different types of loops in C with syntax and example.
65 What is an array? Explain the declaration and initialization of one 2+(2+2)
and two dimensional arrays with examples.
66 What is a structure? Explain the syntax of structure declaration with 2+3+2+3
example. What is a file?
Explain how file-open and file-close operations are handled in C.
67 What is a pointer? Explain how a pointer variable is declared and 2+2
initialized.
68 What are primitive and non-primitive data types? Give examples. 2+2
69 What is meant by sorting? Write the algorithm for bubble-sort. 1+3+2
What is the complexity of bubble-sort?
70 What do you mean by scope of a variable? What are 4 different 2+3+2+3
types of scopes that a variable can have? Explain. What does static
variable mean?
71 What are the differences between malloc () and calloc ()? What are 3+2+4+1
macros? What are its advantages and disadvantages? What is a
static identifier in C?
72 What is a structure in C? What are the differences between 2+3+2+3
structures and arrays? What is a union in C? Explain ‘call by value’
and ‘call by reference’ in context of passing parameters to a
function.
73 What is a reference variable in C++? Describe function overloading 2+4+2+2
and operator overloading. What is recursion? Explain with an
example.
74 What is the difference between a Stack and an Array? Explain with 5+5
examples. What are the advantages of linked list over array (static
Data Structure)?
75 What do you mean by Overflow and Underflow in linked lists? 4+3+3
Define and explain Double Linked List. Briefly describe a Circular
Queue.
76 Explain ‘Sequential Search’ with an example. 3+4+3
Convert the expression ((a + B) * C - (d - E) ^ (f + G)) to equivalent
Prefix and Postfix notations. Describe the ‘Quick Sort’ algorithm.
Write a C program to find the length of a given string.
A palindrome number is one which is same as the number
77 obtained by reversing its digits. 4+6
Write a C program to check whether a given number is
palindrome or not?
Given an array, write a C program to copy the array elements 4+6
78 into another array in reverse order.
Write a C program to read Student records like id, name and
age using a Structure variable and display them by Name.

Вам также может понравиться