Question 1: What will be the output of the following code?
int main()
{
int i = 5;
int a = --i + --i;
printf("%d", a);
return 0;
}
- (A) 8
- (B) 5
- (C) 7
- (D) 6
Question 2: What will be the output of the following code?
int main()
{
int i = 5;
int a = --i + --i + --i;
printf("%d", a);
return 0;
}
- (A) 8
- (B) 5
- (C) 7
- (D) 6
Question 3: What will be the output of the following code?
#include
int main()
{
int num = 8;
printf("%d %d", num << 1, num >> 1);
return 0;
}
- (A) 7 9
- (B) 4 16
- (C) 9 7
- (D) 16 4
Question 4: What will be the output of the following code?
#include
int main()
{
int i = 5;
int a = ++i + ++i;
printf("%d", a);
return 0;
}
- (A) 14
- (B) 13
- (C) 12
- (D) 11
Question 5: What will be the output of the following code?
#include
int main()
{
int i = 16;
i =! i > 15;
printf("i = %d", i);
return 0;
}
- (A) 16
- (B) 1
- (C) 0
- (D) Compilation error
Question 6: What will be the output of the following code?
#include
int main()
{
unsigned int num = -4;
printf("%d", ~num);
return 0;
}
- (A) Compilation error
- (B) 3
- (C) 4
- (D) some garbage value
Question 7: What will be the output of the following code?
#include
int main()
{
int x = 2;
(x & 1) ? printf("true") : printf("false");
return 0;
}
- (A) Compilation error
- (B) true
- (C) false
- (D) Runtime error
Question 8: What will be the output of the following code?
int main()
{
int a = 1, b = 3, c;
c = b << a;
b = c * (b * (++a)--);
a = a >> b;
printf("%d",b);
return 0;
}
- (A) 36
- (B) Compilation error
- (C) 30
- (D) 24
Question 9: What will be the output of the following code?
#INCLUDE
VOID MAIN()
{
INT A=10;
SWITCH(A){
CASE 5+5:
PRINTF("HELLO\n");
DEFAULT:
PRINTF("OK\n");
}
}
- (A) Hello
- (B) OK
- (C) Hello OK
- (D) Error
Question 10: What will be the output of the following code?
void main()
{
int a=2;
switch(a)
{
printf("Message\n");
default:
printf("Default\n");
case 2:
printf("Case-2\n");
case 3:
printf("Case-3\n");
}
printf("Exit from switch\n");
}
- (A) Case-2
- (B) Message
- (C) MessageCase-2
- (D) Case-2 Case-3 Exit from switch
Question 11: What will be the output of the following code?
void main()
{
int a=2;
switch(a/2*1.5)
{
case 1:
printf("One...");
break;
case 2:
printf("Two...");
break;
default:
printf("Other...");
break;
}
}
- (A) One...
- (B) Two...
- (C) Other...
- (D) Error
Question 12: What will be the output of the following code?
#include <stdio.h>
void main()
{
unsigned char var=0;
for(var=0;var<=255;var++)
{
printf("%d ",var);
}
}
- (A) 0 1 2 ... infinite times
- (B) 0 1 2 ... 255
Question 13: C IS _______ TYPE OF PROGRAMMING LANGUAGE.?
- A) OBJECT ORIENTED
- B) PROCEDURAL
- C) BIT LEVEL LANGUAGE
- D) FUNCTIONAL
Question 14: What will be the output of the following code?
#include <stdio.h>
void main()
{
char cnt=0;
for(;cnt++;printf("%d",cnt)) ;
printf("%d",cnt);
}
- (A) 0 1 2 ... infinite times
- (B) 0 1 2 ... 127
- (C) 0
- (D) 1
Question 15: What will be the output of the following code?
#include <stdio.h>
void main()
{
int cnt=1;
do
{
printf("%d,",cnt);
cnt+=1;
} while(cnt>=10);
printf("\nAfter loop cnt=%d",cnt);
printf("\n");
}
- (A) After loop cnt=1
- (B) 1,After loop cnt=2
- (C) After loop cnt=2
Question 16: What will be the output of the following code?
#include <stdio.h>
#define TRUE 1
int main()
{
int loop=10;
while(printf("Hello ") && loop--);
}
- (A) Hello
- (B) Hello Hello Hello Hello ... (Infinite times)
- (C) Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello (10 times)
- (D) Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello (11 times)
Question 17: What will be the output of the following code?
#include <stdio.h>
int main()
{
int i=1;
while(i<=10 && 1++)
printf("Hello");
}
- (A) Error: lvalue required as increment operand
- (B) HelloHello ... 10 times
- (C) HelloHello ... 11 times
- (D) Hello
Question 18: INT MAIN() HOW MANY TIMES THIS LOOP WILL EXECUTE?
{
INT I;
FOR(I=0;I<10 0="" code="" i="++I;" n="" printf="" return="">
- (A) 10
- (B) 5
- (C) 4
- (D) NONE OF THESE
Question 19: WHICH OF THE FOLLOWING SENTENCES ARE CORRECT ABOUT A FOR LOOP IN A C PROGRAM?
- A) FOR LOOP WORKS FASTER THAN A WHILE LOOP.
- B) ALL THINGS THAT CAN BE DONE USING A FOR LOOP CAN ALSO BE DONE USING A WHILE LOOP.
- C) FOR(;;); IMPLEMENTS AN INFINITE LOOP.
- D) FOR LOOP CAN BE USED IF WE WANT STATEMENTS IN A LOOP GET EXECUTED AT LEAST ONCE.
Question 20: A CHAR VARIABLE CAN STORE EITHER AN ASCII CHARACTER OR A UNICODE CHARACTER.
- A. TRUE
- B. FALSE
Question 21: HIGHT LEVEL LANGUAGE IS A?
- A) HUMAN READABLE LIKE LANGUAGE.
- B) LANGUAGE WITH SMALL PROGRAM SIZE.
- C) LANGUAGE WITH BIG PROGRAM SIZE.
- D) LANGUAGE WHICH IS DIFFICULT TO UNDERSTAND AND NOT HUMAN READABLE.
Question 22: C IS _______ TYPE OF PROGRAMMING LANGUAGE.?
- A) OBJECT ORIENTED
- B) PROCEDURAL
- C) BIT LEVEL LANGUAGE
- D) FUNCTIONAL
Question 23: CHOOSE CORRECT STATEMENTS
- A) A CONSTANT VALUE DOES NOT CHANGE. A VARIABLE VALUE CAN CHANGE ACCORDING TO NEEDS.
- B) A CONSTANT CAN CHANGE ITS VALUES. A VARIABLE CAN HAVE ONE CONSTANT VALUE ONLY.
- C) THERE IS NO RESTRICTION ON NUMBER OF VALUES FOR CONSTANTS OR VARIABLES.
- D) CONSTANTS AND VARIABLES CAN NOT BE USED IN A SINGLE MAIN FUNCTION.
Question 24: FIND A CORRECT C KEYWORD BELOW.
- A) BREAKER
- B) GO TO
- C) SHORTER
- D) DEFAULT
Question 25: FIND A CORRECT C KEYWORD BELOW.
- A) WORK
- B) CASE
- C) CONSTANT
- D) PERMANENT






