You are on page 1of 24

Question

If Microprocessor permits to access 16 MB RAM, then address bus width must be


When Function allocates memory from stack area ,its address always grows
Which is the following statement is true
Which byte order is followed by Motorola Processors?
The relational operator == (equality) always returns
if( test( ) ) i++;
Which modifier almost doubles the largest value of an integer?
What is the half of the address 0XFFFFF
Find out the output
void main()
{
printf("%d %d",4.5,4);
}
Find out the output
void main()
{
printf("%%d",5);
}

Find out the output


void main()
{
char x=-130;
char y=-5;
printf("%i",x+y);
}

Find out the output


void main()
{
unsigned int x=500;
int y=-5;
if(x>y)
printf("Hello");
else
printf("Hi");
}

Find the output


void main()
{
int a=8,x;
x=++a+++a+++a;
printf("%d %d",x,a);
}

Bitwise operators are applicable only on


Find the output
void main()
{
int x,y;
x=10;
y=sizeof(++x);
printf("x=%d y=%d",x,y);
}
Which operator is used both as an operator and keyword?
Find the Output
void main()
{
goto start;
{
int a=1;
start:printf("%d",a);
}
}

What is the output of the following program?


main ( )
{ int x = 2, y = 5;
if (x < y) return (x = x+y); else printf (z1);
printf(z2);
}
Choose the correct one
What is the following program doing?
main ()
{ int d = 1;
do
printf(%d\n, d++);
while (d < = 9);}

What is the output of the following program?


main ( )
{ extern int x;
x = 20;
printf(\n%d, x);
}

If x is one dimensional array, then pick up the correct answer


Consider the following declaration
int a, *b = &a, **c = &b;
The following program fragment
a = 4;
**c = 5;
Choose the correct answer
The content of file will be lost if it is opened in
Consider the following code segment:
int a[10], *p1, *p2;
p1 = &a[4];
p2 = &a[6];
Which of the following statements is incorrect w.r.t. pointers?
The second expression (j k) in the following expression will be evaluated
(i + 5) && (j k)
In the for statement: for (exp1; exp2; exp3) { }
where exp1, exp2 and exp3 are expressions. What is optional?
The output of the following code segment will be
char x = B;
switch (x) {
case A: printf(a);
case B: printf(b);
case C: printf(c);
}
What will be the output of the following code segment?
main( ) {
char s[10];
strcpy(s, abc);
printf(%d %d, strlen(s), sizeof(s));
}
Which of the following is the odd one out?
Which of the following is true for the statement:
NurseryLand.Nursery.Students = 10;

What will be the output of the following code segment, if any?


myfunc ( struct test t) {
strcpy(t.s, world);
}
main( ) {
struct test { char s[10]; } t;
strcpy(t.s, Hello);
printf(%s, t.s);
myfunc(t);
printf(%s, t.s);
}
If a function is declared as void fn(int *p), then which of the following statements is
valid to call function fn?
What is the output of the following C program?
# include <stdio.h>
main ( )
{
int a, b=0;
static int c [10]={1,2,3,4,5,6,7,8,9,0};
for (a=0; a<10;+ + a)
if ((c[a]%2)= = 0) b+ = c [a];
printf (%d, b);
}
If a, b and c are integer variables with the values a=8, b=3 and c=-5. Then what is the
value of the arithmetic expression:
2 * b + 3 * (a-c)
A global variable is a variable
main ( ) is an example of
While incrementing a pointer, its value gets increased by the length of the data type to
which it points. This length is called
The first digit of a decimal constant must be
What is the output of the following statement:
printf (%-3d,12345);
A single character input from the keyboard can be obtained by using the function.
The function ftell ( )
If the variables i, j and k are assigned the values 5,3 and 2 respectively, then the
expression i = j + ( k + + = 6 ) + 7
If an integer needs two bytes of storage, then the maximum value of a signed integer
is
Literal means
If y is of integer type then the expressions
3* (y 8)/9 and (y 8)/9 * 3

In the following code fragment


int x, y = 2, z, a;
x=(y*=2) + (z=a=y);
printf (%d,x);
A possible output of the following program fragment is
for (i=getchar();; i=get.char())
if (i==x) break;
else putchar(i);
In a for loop, if the condition is missing, then,
If storage class is missing in the array definition, by default it will be taken to be
The maximum number of dimensions an array can have in C is
puts(argv[0]);
printf(%10s, ABDUL); displays
Which amongst the following expression uses bitwise operator?
The output of the following program is
main( )
{ float y;
y=198.7361;
printf(%7.2f, y);
}
Which is not dynamic memory allocation function?
Which header file is used for screen handling function:Choose the directive that is used to remove previously defined definition of the macro
name that follows it The output of the following is
x = a;
printf(%d, x);
Consider the following statement
int j, k, p;
float q, r, a;
a = j/k;
p=q/r;
If q=7.2, r=20, j=3, k=2
The value of a and p is
Choose the function that returns remainder of x/y What is the output of following program:int q, *p, n;
q = 176; If the address of q is 2801
p = &q; and p is 2600
n = *p;
printf(%d, n);
Consider the following statements
x= 5;
y = x >3 ? 10 : 20;
The value of y is

Determine which of the following is an invalid character constant.


What is the name of built-in function for finding square roots?
What is the output of following statement?
for(i=1; i<4; i++)
printf(%d,(i%2) ? i : 2*i);
Which of the following statement is true about a function?
What is the output of the following program?
main( )
{
int i=4, z=12;
if(i=5 || z>50)
printf(hello);
else
printf(hye);
}
For implementing recursive function the data structure used is:
The size of array int a[5]={1,2} is
Which of the following is not an escape sequence?
The output of the following statements is
char ch[6]={e, n, d, \0, p};
printf(%s, ch);
How many times the following code prints the string hello.
for(i=1; i<=1000; i++);
printf(hello);
Find the invalid identifiers from the following:(i) nA (ii) 2nd (iii) ROLL NO (iv) case
The void type is used for
The valid octal constants from the following
(i) 0245 (ii) 0387 (iii) 04.32 (iv) 0467
The variable that are declared outside all the functions are called ______.
Consider the following statements:int x = 6, y=8, z, w;
y = x++;
z = ++x;
The value of x,y,z by calculating the above expressions are:To declare an array S that holds a 5-character string, you would write
The function used to read a character from a file that has been opened in read mode is
The function that allocates requested size of bytes and returns a pointer to the first
byte of the allocated space is The constructed datatype of C is known as
The postfix form of the following infix notation is : (A + B)* (C*D E)* F
The number of nodes in a complete binary tree of depth d (with root at depth 0) is
The average case of quick sort has order
Inorder to get the information stored in a BST in the descending order, one should
traverse
it in which
following
order? degree 2 can have
Every internal
node of
in the
a B-tree
of minimum

Which sorting algorithm is the best if the list is already in order?


In _________ the difference between the height of the left sub tree and height of right
sub tree,
for of
each
node, is not
more than
one5 numbers in ascending order using bubble
The
number
comparisons
required
to sort
sort
is
The complexity
of adding two matrices of order m*n is
The second largest number from a set of n distinct numbers can be found in
If the inorder and preorder traversal of a binary tree are D,B,F,E,G,H,A,C and
A,B,D,E,F,G,H,C
the postorder
traversal
of The
thatnumber
tree is of nodes with
In
a binary tree,respectively
the number then
of terminal
or leaf nodes
is 10.
two
children
is the following cannot be a balance factor of any node of an AVL tree?
Which
amongst
How many distinct binary search trees can be formed which contains the integers 1, 2,
3?
The sort which inserts each elements A(K) into proper position in the previously sorted
sub
array
A(1), ...,access
A(K1)of elements is not possible in
Direct
or random
Level of any node of a tree is
A desirable choice for the partitioning element in quick sort is
lg (n!) =____________
The result of evaluating the following postfix expression is
5, graph
7, 9, *,with
+, 4,
3, /, +,will
- definitely have a parallel edge or self loop if the total
A
n 9,
vertices
number
of
edges
are
Out of the following, the slowest sorting procedure is
In ________, it is possible to traverse a tree without using stacks either implicitly or
explicitly.
The order of a B-Tree with 2, 3, 4 or 5 children in every internal node is
The number of nodes that have no successors in a complete binary tree of depth 4 is
One can make an exact replica of a Binary Search Tree by traversing it in
A complete Binary Tree with 15 nodes contains________edges
The minimum number of comparisons required to find the largest number from 4
different
numbers are
An infix expression
can be converted to a postfix expression using a
A data structure in which an element is added and removed only from one end, is known
as
A complete binary tree with the property that the value of each node is at least as
large
as the
values of
children
is known as
A sorting
algorithm
is its
stable
if
A tree in which, for every node, the difference between the height of its left subtree
and
right structure
subtree isneeded
not more
than onea is
The data
to convert
recursion to an iterative procedure is
A binary tree stored using linked representation can be converted to its mirror image
by
it of
in an infix expression A+B-C*D is
Thetraversing
prefix form
The number of edges in a simple, n-vertex, complete graph is
The largest and the second largest number from a set of n distinct numbers can be
found
in
To implement
Sparse matrix dynamically, the following data structure is used
The balance factor for an AVL tree is either
Applications of Linked List are
AVL trees have LL, LR, RR, RL rotations to balance the tree to maintain the balance
factor
(LR
: Insertresolution
node in Right
sub treeare
of Left sub tree of node A, etc). Among
Hashing
collision
techniques
The running time of the following sorting algorithm depends on whether the
partitioning
is balanced or
unbalanced
Graphs are represented
using
The average case complexity of Insertion Sort is
Infinite recursion leads to
The number of unused pointers in a complete binary tree of depth 5 is
The running time for creating a heap of size n is
What would be returned by the following recursive function after we call test (0, 3)
int test (int a, int b)

The extra key inserted at the end of the array is called a


Which of the following operations is performed more efficiently by doubly linked
list
by singly linked
list a Binary tree is a Binary Search Tree by traversing it in
Onethan
can determine
whether
The spanning tree of connected graph with 10 vertices contains
A sorted file contains 16 items. Using binary search, the maximum number of
comparisons
to search
for anan
item
inexpression
this file is has balanced parenthesis or not by using
One can determine
whether
infix
The average number of key comparisons done in successful sequential search in a list of
length
n is
The maximum
number of nodes in a binary tree of depth 5 is
n elements of a Queue are to be reversed using another queue. The number of ADD
and
REMOVE
operations
required
to do has
so is
A complete
binary
tree with
n leaf nodes
A binary tree can be converted in to its mirror image by traversing it in
One can convert an infix expression to a postfix expression using a
Which of the following types of expressions do not require precedence rules for
evaluation?
Overflow condition in linked list may occur when attempting to_____
Linked lists are not suitable data structures for which one of the following problems
The sorting technique where array to be sorted is partitioned again and again in such a
way
that alltechnique
elements for
lesssearching
than or equal
to partitioning
element
appear before
and
The search
a sorted
file that requires
increased
amountitof
space i
The postfix form of A ^ B * C - D + E/ F/ (G + H),
The prefix of (A+B)*(C-D)/E*F
A sorting technique which uses the binary tree concept such that label of any node is
larger
than all
thewith
labels
the subtrees,
is called
A full binary
tree
'n' in
non-leaf
nodes contains
A graph 'G' with 'n' nodes is bipartite if it contains
Recursive procedures are implemented by using ____ data tructure.
In ______, the difference between the height of the left sub tree and height of the right
tree, for each node, is almost one.

20 bits
24 bits
32 bits
up
down
Left
Copy of the variable is c Copy of the variable is Created both
Little-Endian
Big-Endian
Bi-Endian
0
1 0 or 1
i value is incremented if i value is incremented ii value is incremented if
signed
unsigned
short
0X80000
0X7FFFF
0X00000

45

0 garbage

5% %d

-135

Hi

05

-3

Hello

Compilation Error

33 11
integers

24 11
24 5
integers and charactersintegers and floats

x=10 y=2
x=10 y=4
Right shifting operator cast operator

Compilation error
sizeof operator

0 Garbage

z2
z1z2
Compilation error
Address operator can notAddress operator can be
Use of register declarati

Adding 9 integers

Adding integers from 1 Displaying integers from

20 error

*(x + i) is same as &x[i] *&x[i] is same as x + i *(x + i) is same as x[i] +

does not change the valuassigns address of c to assigns the value of b to


enum variable can not b enum variable can be enumeration feature incr
w mode
w+ mode
a mode

p1 + 2

p2 2

p2 + p1

if expression (i + 5) is tr if expression (i + 5) is firrespective of whether (i


None of the expressions Only
i
exp1 is optional. Only exp1 and exp3 are o

BC

3 10
j = j + 1;

33
j =+ 1;

10 3
j++;

The structure Students isThe structure NurseryLa


The structure Nursery is

Hello Hello

world world

Hello world

fn(x) where x is defined a


fn(x) where x is definedfn(&x) where x is defined

20

25

45

45
6
-16
declared in the main ( ) fdeclared in any function
declared outside the bod
library function
user defined function header
scale factor
a zero

length factor
a non zero number

pointer factor
a negative number

123
-1 2 3
12345
printf ( )
scanf ( )
putchar ( )
reads a character from areads an integer from agives the current position
gives an error message assigns a value 16 to i assigns a value 18 to i
2^16-1
a string

2^15-1
a string constant

2^16
a character

must yield the same valumust yield different valmay or may not yield the

prints 8

prints 6

prints 6 or 8 depending

mi
mix
mixx
It is assumed to be preseIt is assumed to be pre It results in a syntax erro
automatic
external
static
3
4
5
prints the name of the soprints argv.
prints the number of co
ABDULbbbbb
bbbbbABDUL
ABDULbbbbbbbbbb
a++
!a>5
a|b

198.736
malloc
IO.H

198.73
free
STDLIB.H

198.74
alloc
CONIO.H

# remdef

# pragma

# undef

a=1.5, p=3.6
remainder( )

a=2, p=3
mod( )

97

None of the above


modulus( )

2801

176

2600

10

20

\a
square(x)

T
sqr(x)

\0
sqrt(x)

143
123
246
An invoking function musEvery function returns a
A function may contain

hello
Queue

hye
Stack
4

syntax error
Linked List
8

20

\n

\r

endp

end0p

end

1000 Zero

(i), (ii) and (iv)


Returning the value

(i) and (iii)


(ii), (iii) and (iv)
creating generic pointeCreating functions

(i) and (ii)


Local variable

(iii) and (iv)


Global variable

(ii) and (iii)


Auto variable

y=8, z=8, x=6


char S[5]
putc

y=6, x=8, z=8


String S[5]
getc

y=9, z=7, x=8


char S[6]
getchar

realloc
Pointers
AB + CD*E *F*
2^(d-1)+1
O(n^2)
left, root, right
2, 3 or 4 children

malloc
String
AB+ CDE + * F*
2^(d+1)-1
O(n)
root, left, right
1, 2 or 3 children

calloc
Structure
AB+ CD EF + **
2^(d-1)-1
O(n log n)
right, root, left
2, 4 or 6 children

Quick sort
BST

Merge sort
Complete Binary Tree
7

m+n
O(n)
D,F,G,A,B,C,H,E

Insertion sort
AVL-tree
6

mn
O(2n)
F,H,D,G,E,B,C,A
9
1
6

10
max(m, n)
O(n^2)
C,G,H ,F,E,D,B,A

11
0
5

15
2
4

Insertion sort
Radix sort
Merge sort
Linked list
Array
String
Height of its left subtreeHeight of its right subt Its distance from the roo
First element of the list Last element of the listRandomly chosen element
O (n)
O (lg n)
O (n^2)
50
65
61
more than n
more than n+1
more than (n+1)/2
Quick Sort
Heap Sort
Shell Sort
Threaded binary trees. AVL Tree
B+ tree
2
3
4
0
8
16
Inorder
Preorder
Postorder
15
30
14
4
3
5
Stack
Queue
Dequeue
Queue
Stack
In-built structure
Binary Search Tree.
AVL Tree.
Heap.
its time complexity is co preserves the original oits space complexity is c
AVL Tree.
Complete Binary Tree. B Tree.
Queue.
Graph.
Stack.
Inorder.
Preorder.
Postorder.
+AB-*CD.
-+A B C * D.
-+A B * C D.
n*(n-2).
n*(n-1).
n*(n-1)/2.
O (n).
O (2n).
O (n^ 2 )
Trees
Graphs
Priority Queues
0,1 or 1
2,1 or 0
0,1 or 2
Simulation , event drive Postfix and prefix mani Dictionary systems, pol
LL, RL and LR, RR
LL, RR and LR, RL
LR, RR and LL, RL
Huffman coding, linear hBucket addressing, HufChaining, Huffman codin
Insertion sort
Selection sort
Quick sort
Adjacency tree
Adjacency linked list
Adjacency graph
O(2^n)
O(n^3)
O(n^2)
Overflow of run-time staUnderflow of registers Overflow of I/O cycles
4
8
16
O (n)
O (log n)
O (n log n)
1
2
3

End Key
Stop Key
Sentinel
Deleting a node whose loSearching of an unsorted
Inserting a new node aft
Preorder
Inorder
Postorder
9 edges
11 edges
10 edges
15
8
1
Array
Queue
Stack
log n
(n-1)/2
n/2
31
16
32
2*n
4*n
n
n+1 nodes
2n-1 nodes
2n+1 nodes
Inorder
Preorder
Postorder
stack
Queue
Deque
fully parenthesised infix postfix expression
partially parenthesised i
Create a node when freeTraverse the nodes when
Create a node when linked
insertion sort
binary search
radix sort
merge sort
quick sort
selection sort
indexed sequential searcinterpolation search
sequential search
AB^C*D-EF/GH+/+
AB^CD-EP/GH+/+*
ABCDEFGH+//+-*^
/+-AB*CD.
/*+-ABCD*EF.
*/*+AB-CDEF.
selection sort.
insertion sort.
Heap sort.
log2 n nodes
n+1 nodes.
2n nodes.
n edges.
a cycle of odd length. no cycle of odd length.
queues.
stacks.
linked lists.
Binary search tree
AVL - tree
Complete tree

Answer

None
right
Not created in both
None
None

B
B
B
B
C

None
long
None

B
D
B

None of these

None of these

121 D

None of these

compilation error
D
integers,floats,and doubA

None of these
B
Token pasting operator C

None of these

None of these
None of the above

D
A

None of these

garbage value

*(x + i) is same as *x[i]


A
A

assigns 5 to a
None of the above
a+ mode

D
C
A

p2 p1

will not be evaluated in A


All the expressions are oD

bc

10 10
j += 1;

A
B

The structure Nursery isC

the program will not co D


fn(*x) where x is definedC

90 A

-1 A
declared any where in t C
statement
A
increment factor
an integer

D
D

12 C
getchar ( )
D
sets the position to the C
assigns a value 19 to i A
2^15
an alphabet

B
B

none of the above.

is syntactically wrong

none of the above


D
Execution will be terminB
either automatic or exteA
compiler dependent
D
prints the name of the eD
bbbbbbbbbbABDUL
A
a!=b
C

1 9 8 . 7 35
calloc
STDIO.H

C
C
D

# define

None of the above

a=1, p=3
rem( )

C
C

None of the above

3A

/n
No built-in function

D
C

226
A
Every function must be d
A

hellohye
Tree
\p

A
B
2C
D

error

Syntax error

(ii), (i) and (iii)


Avoid error

C
B

(i) and (iv)


None of the above

D
B

y=7, x=8, z=7


String S[6]
putchar

B
A
B

none of the above


Array
ABCDEF* + * +
2^(d+1)+1
O(log n)
right, left, root
0, 2 or 4 children

B
C
A
B
C
C
B

Heap sort
B-tree

C
C
5C
min(m, n)
B
O(log n)
A
D,F,H,G,E,B,C,A
D
20 A
1
C
3B
Bubble sort
A
None of these
A
None of these
C
Median of the list
A
O (n lg n)
D
69 C
more than n(n-1)/2
D
Bubble Sort
D
Heap
C
5C
4B
Any order
B
16 C
6B
None of these
A
None of the above
B
Threaded Binary Tree. C
it sorts any volume of d B
B+ tree
A
Tree.
C
Any order.
B
- + *ABCD.
C
n*(n-1)*(n-2)
C
O (log n).
A
Linked List
D
All the above
A
Fixed block storage alloD
LR, RL and LR, RL
B
Chaining, Bucket addresD
Merge sort
C
Adjacency queue
B
O(2n)
Underflow of run-time s A
32 C
O (n^2)
C
4D

Transposition
C
Traversing the list to p A
Any of the three orders B
9 vertices
A
4D
Tree
C
(n+1)/2
D
15 A
The task cannot be accoD
n(n-1)/2 nodes
B
Anyorder
B
none of these
A
more than one of the abA
None of these.
A
polynomial manipulatio B
none of these
B
tree search
A
AB^D +EFGH +//*+
A
**AB+CD/EF.
C
quick sort.
C
2n+l nodes.
D
n^2 edges.
C
strings.
B
Threaded binary tree
B

You might also like