Está en la página 1de 42

QUIZ in C

language

For the ELTP 922


Batch
OBJECTIVE

To have an interactive revision of the last


week topics
To know some new things about the
language
RULES
There will be direct questions to respective
team and if not answered will be passed
in a cyclic order.
direct question will fetch a 100 marks
where as a passed question will fetch no
marks.(depends)
We have a responsibility of making an
interactive yet peaceful session
ROUND 1

WARM
UP
Question 1
In a stack, _________.
A. The first element to be inserted is deleted
first
B. The first element to be inserted is deleted
last
C. A non-linear relationship exists
D. None of the above
Answer

B A stack
is either
FIFO
Or
LIFO
Question 2
2. A queue is _______ type structure.
A. FILO
B. Complex
C. FIFO
D. LIFO
Answer
A Queue Is Always
FIFO
C
Question 3
Pick up the valid statement from the
following: Queues can be used _______.
A. for printing jobs on a Line Printer
B. to access a Disk
C. in function calls
D. None of the above
Answer

Printer
A operation
is a
Queue
Question 4
Assuming F and R are indices to front and
Rear, when insertion takes place in a
queue, which of them proves valid?
A. F=F+1
B. R=R+1
C. F=F-1
D. R=R-1
Answer

B In a Queue
new
element is
added
from rear
Question 5
Which of the following is an application of
a queue?
A. CPU Scheduling
B. Validating and evaluating arithmetic
operations
C. Managing sub-routine calls
D. Searching
Answer

Cpu
A Sheduling
also is a
Queue
Operation
ROUND 2
C O
U
R T
A P
U
Z T
Y S
Question 1
int x,y;
x = 3;
y = (x>5 ? 3 : 4);
Print(y);
Answer

4 If(x>5)
Y=3
Else
Y=4
Question 2
main()
{
float a=12.25,b=-12.25;
if(a=b)
printf("a and b are equal");
else
printf("not equal");
}
Answer

a & b are
equal We used
assignment
operator
Question 3
main()
{
int i=6,j=1;
for(;;)
{
if(i>5)
break;
else
j+=i;
printf("\n%d",j);
i+=j;
}
}
Answer

No output
Break will
take the
control out of
the loop.
Question 4
struct emp
{ char name[20];
int age;
float sal;
};
struct emp e={"tiger"};
printf("\n%d%f",e.age,e.sal)
;
Answer

0 0.0000 No values
initialized so it
stores 0 value
Question 5
static int a[20];
int i=0;
a[i]=i++;
printf("\n%d%d%d",a[0],
a[1],i);
Answer

001 No need of
explanation
ROUND 3
M B
U
I S
N T
E
D R
S
Question 1
The node with no children is
called _______.
A. Leaf node
B. Non-Leaf node
C. Non-terminal node
D. Root node
Answer

A LEAF NODE
Question 2
Inorder traversal on a Binary
Search Tree constructed for a
given numbers always results in
A. Ascending order
B. Descending order
C. A & B
D. None of the above
Answer
ASCENDING
A ORDER
Question 3
The following sequence of operation
are performed on stack, push(1),
push (2), pop, push(2), push(2), pop,
pop, pop, push(2), pop. The
sequence of popped out values are
A. 2, 2,2,1,2
B. 2, 2,1,2,2
C. 2, 1,2,2,1
D. 2, 1,2,2,2
Answer
Just Follow the
A Order .
Question 4
The disadvantage of Linked
Storage is _______.
A. Complex
B. Use of extra space
C. Inefficient for small records
D. None of the above
Answer
USES EXTRA
B STORAGE
Question 5
A switch statement can be input
with a pointer expression and
matched against pointer case
values. (True / False) ?
Answer
Switch
FALSE statement
can take only
char or int as
input.
ROUND 4
C W
O
O R
D L
D
I
N
G
Question 1
Write down the code for
Fibonacci series
Question 2
Write down the code for
Armstrong No
Question 3
Write down the code to pass the
entire array to a function.
Question 4
Write down the code for Selection
Sorting
Question 5
Write down the code for Binary
Search.

También podría gustarte