C Online Exam-Quiz2

C Online Exam-Quiz1

1.

What will be the output of the following statement ?
printf( 3 + “goodbye”);

 
 
 
 

2.

What will be the output of the following arithmetic expression ?

 
 
 
 

3.

What will be output if you will compile and execute the following c code?
#include “string.h”
void main(){
clrscr();
printf(“%d %d”,sizeof(“string”),strlen(“string”));
getch();
}

 
 
 
 

4.

What will be the output of the following statements ?
long int a = scanf(“%ld%ld”,&a,&a); printf(“%ld”,a);

 
 
 
 

5. What will be output if you will compile and execute the following c code?
#define call(x) #x
void main(){
printf(“%s”,call(c/c++));
}

 
 
 
 

6.

The Default Parameter Passing Mechanism is called as

 
 
 
 

7.

The statement printf(“%c”, 100); will print?

 
 
 
 

8.

What will be output if you will compile and execute the following c code?
void main(){
int a=25;
clrscr();
printf(“%o %x”,a,a);
getch();
}

 
 
 
 

9.

What will be the output of the following statements ?
int a = 4, b = 7,c; c = a = = b; printf(“%i”,c);

 
 
 
 

10.

What will be output if you will compile and execute the following c code?
void main()
{
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf(“%d”,i);
}
else
printf(“equal”);
}

 
 
 
 

11.

What will be the output of the following program ?
#include
void main()
{
int a = 36, b = 9;
printf(“%d”,a>>a/b-2);

 
 
 
 

12.

What will be output if you will compile and execute the following c code?
#define message “union is\
power of c”
void main(){
clrscr();
printf(“%s”,message);
getch();
}

 
 
 
 

13.

The “C” language is

 
 
 
 

14.

What will be the output of the following program ?
#include
void main()
{ int a = 2;
switch(a)
{ case 1:
printf(“goodbye”); break;
case 2:
continue;
case 3:
printf(“bye”);
}
}

 
 
 
 

15.

What will be the output of the following statements ?
int i = 1,j; j=i— -2; printf(“%d”,j);

 
 
 
 

16.

What would be the output of the following program?
#include
main()
{
char str[]=”S\065AB”;
printf(“\n%d”, sizeof(str));
}

 
 
 
 

17.

5. What will be the output of the following statements ?
int a = 5, b = 2, c = 10, i = a>b
void main()
{ printf(“hello”); main(); }

 
 
 
 

18.

What will be the output of the following statement ?
int a=10; printf(“%d &i”,a,10);

 
 
 
 

19.

What will be output if you will compile and execute the following c code?
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf(“%d %d %d”,s.p,s.c,s.m);
}

 
 
 
 

20.

What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

 
 
 
 

Question 1 of 20

error: Content is protected !!