Question 1
Write the output of the following C program
#include <stdio.h>
int main (void)
{
int shifty;
shifty = 0570;
shifty = shifty >>4;
shifty = shifty <<6;
printf("the value of shifty is %o",shifty);
}
the value of shifty is 15c0
the value of shifty is 4300
the value of shifty is 5700
the value of shifty is 2700
Question 2
The following three 'C' language statements is equivalent to which single statement? y=y+1; z=x+y; x=x+1
z = x + y + 2;
z = (x++) + (++y);
z = (x++) + (y++);
z = (x++) + (++y) + 1;
Question 3
How many lines of output does the following C code produce?
#include<stdio.h>
float i=2.0;
float j=1.0;
float sum = 0.0;
main()
{
while (i/j > 0.001)
{
j+=j;
sum=sum+(i/j);
printf("%f\n", sum);
}
}
8
9
10
11
Question 4
What is the output of the following C program?
#include <stdio.h>
#define SQR(x) (x * x)
int main()
{
int a;
int b = 4;
a = SQR(b + 2);
printf("%d", a);
return 0;
}
14
36
18
20
Question 5
Consider a 50 kbps satellite channel with a 500 milliseconds round trip propagation delay. If the sender wants to transmit 1000 bit frames, how much time will it take for the receiver to receive the frame?
250 milliseconds
20 milliseconds
520 milliseconds
270 milliseconds
Question 6
Which of the following is not a valid multicast MAC address?
01:00:5E:00:00:00
01:00:5E:00:00:FF
01:00:5E:00:FF:FF
01:00:5E:FF:FF:FF
Question 7
A mechanism or technology used in Ethernet by which two connected devices choose common transmission parameters such as speed, duplex mode and flow control is called
Autosense
Synchronization
Pinging
Auto negotiation
Question 8
The five items: A, B, C, D, and E are pushed in a stack, one after other starting from A. The stack is popped four items and each element is inserted in a queue. The two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is
A
B
C
D
Question 9
Consider the following sorting algorithms.
I. Quicksort
II. Heapsort
III. Mergesort
Which of them perform in least time in the worst case?
I and II only
II and III only
III only
I, II and III
Question 10
Which of the following is true with respect to Reference?
A reference can never be NULL
A reference needs an explicit dereferencing mechanism
A reference can be reassigned after it is established
A reference and pointer are synonymous
There are 80 questions to complete.