main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf(“%d,”,i);
}
}
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf(“%d,”,i);
}
}
a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error
Ans. (d
Q) What is the output in the following program
main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf(“pass1,”);
if(c
printf(“pass2″);
else
printf(“Fail2″);
}
else
printf(“Fail1);
if(i
printf(“pass2″);
else
printf(“Fail2″)
}
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf(“pass1,”);
if(c
printf(“pass2″);
else
printf(“Fail2″);
}
else
printf(“Fail1);
if(i
printf(“pass2″);
else
printf(“Fail2″)
}
a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these
Ans. (c)
Q) In the process table entry for the kernel process, the process id value is
(a) 0
(b) 1
(c) 2
(d) 255
(e) it does not have a process table entry
Ans. (a)
(a) 0
(b) 1
(c) 2
(d) 255
(e) it does not have a process table entry
Ans. (a)
Q) If Log2 x – 5 Log x + 6 = 0, then what would the value / values of x be?
Ans.. x = e2 or e3.
Q)A man ate 100 bananas in five days, each day eating 6 more than the previous day. How many bananas did he eat on the first day?
Ans.. Eight.
Q) If it takes five minutes to boil one egg, how long will it take to boil four eggs?
Ans.. Five minutes.
Q)Three pipes, A, B, & C are attached to a tank. A & B can fill it in 20 & 30 minutes respectively while C can empty it in 15 minutes. If A, B & C are kept open successively for 1 minute each, how soon will the tank be filled?
Ans.167 minutes.
Q)A person walking 5/6 of his usual rate is 40 minutes late. What is his usual time?
Ans.. 3 hours 20 minutes.
Q) If (NM)2= RRM where N.M & R are distinct digits. Then possible values for R are
(a) 1 (b) 2 (c) 3 (d) none of these
Ans (b) -2
Q) A man buys spirit at Rs. 60 per letter, adds water to it and then sells it at Rs. 75 per litter. What is the ratio of spirit to water if his profit in the feal is 37.5%?
(a) 9:1 (b) 10:1 (c) 11:1 (d) None of these.
Ans (b) 10.1
Q)A certain quantity of petrol is found to be adulterated to the extent of 10%. What proportion of the adulterated petrol should be replaced with pure petrol to take the purity level to 98%?
(a) 80% (b) 32% (c) 66.67% (d) cannot be determined.
Ans (a) 80%