 For Latest Job Updates  Home Govt Jobs IT Fresher Jobs IT Exp Jobs IT Walk-Ins MBA Jobs BPO Jobs Register FAQ’s Post Job Contact Us
 Search: Feeds Welcome GuestLogin | Register
Total No Of Questions: 20.
1)

void  main()

{

int i=3;

switch(i)

{

default:printf("zero");

case 1: printf("one");

break;

case 2:printf("two");

break;

case 3: printf("three");

break;

}

}

 a. Three b. one c. two d. zero

2) Which of the following statements should be used to obtain a remainder after dividing 3.5 by 2.5 ?
 a. rem = 3.5 % 2.5; b. rem = modf(3.5, 2.5); c. rem = fmod(3.5, 2.5); d. Remainder cannot be obtain in floating point division.

3)

What will be the output of the program?

#include<stdio.h>

int main()

{

int i=4;

switch(i)

{

default:

printf("This is default\n");

case 1:

printf("This is case 1\n");

case 2:

printf("This is case 2\n");

break;

case 3:

printf("This is case 3\n");

}

return 0;

}

 a. This is default This is case 1This is case 2 b. This is case 3 This is default c. This is case 1 This is case 3 d. This is default

4) #include int main() { int a = 1000; switch(a) { } printf("This is c program."); return 0; }
 a. Error: No case statement specified b. Error: No default specified c. No Error d. Error: infinite loop occurs

5) What will be the output of the program? #include int main() { int i=0; for(; i<=5; i++); printf("%d,", i); return 0; }
 a. 0, 1, 2, 3, 4, 5 b. 5 c. 1, 2, 3, 4 d. 6

6)

Point out the error in the following program.

#include<stdio.h>

int main()

{

display();

return 0;

}

void display()

{

printf("Disp fun");

}

 a. No error b. Disp fun c. Compilation error: Type mismatch in redeclaration of function display() d. None of these

7) Point out the error, if any in the while loop. #include int main() { void fun(); int i = 1; while(i <= 5) { printf("%d\n", i); if(i>2) goto here; } return 0; } void fun() { here: printf("It works"); }
 a. No Error: prints "It works" b. Error: fun() cannot be accessed c. Error: goto cannot takeover control to other function d. No error

8) Which of the following cannot be checked in a switch-case statement?
 a. Character b. Integer c. Float d. enum

9)

void main(){

int a= 0;int b = 20;char x =1;char y =10;

if(a,b,x,y)

printf("hello");

}

 a. nooutput b. hello c. error d. none of the above

10) What is the output of the program #include int main() { struct emp { char name; int age; float sal; }; struct emp e = {"Tiger"}; printf("%d, %f\n", e.age, e.sal); return 0; }
 a. 0, 0.000000 b. Garbage values c. Error d. None of above Page 1 of 2 