c_anilcomputers_udaipur

C Language QUIZ 01

Total no of Question = 25

All Questionnaire compulsory to answered

Quiz created by :   Anilcomputersudaipur.com

Add: Anil Computers, 368, Prem Kutir, Univestiy Main Road Nr. Tulsi Garden, Udaipur- 094142 34600

C Language Quiz 01

Please enter your email:

1. What will be the output of following statements ?
char x[ ] = ?hello hi?; printf(?%d%d?,sizeof(*x),sizeof(x));

 
 
 
 

2. 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);
}

 
 
 
 

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

 
 
 
 

4. What will be the output of the following statements ?
int x[4] = {1,2,3}; printf(?%d %d %D?,x[3],x[2],x[1]);

 
 
 
 

5. What will be the output of the following statements ?
int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf(?%d?,d);

 
 
 
 

6. What will be the output of the following arithmetic expression ?
5+3*2%10-8*6

 
 
 
 

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

 
 
 
 

8. What will be the output of following program ?
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(?%d?,x);
}

 
 
 
 

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

 
 
 
 

10. 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?);
}
}

 
 
 
 

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 the output of the following statements ?
int a = 5, b = 2, c = 10, i = a>b
void main()
{ printf(?hello?); main(); }

 
 
 
 

13. . void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf(?EXAM?);
}
}
What is the output?

 
 
 
 

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

 
 
 
 

15. int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
What value does testarray[2][1][0] in the sample code above contain?

 
 
 
 

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

 
 
 
 

17. What will be the value of `a` after the following code is executed
#define square(x) x*x
a = square(2+3)

 
 
 
 

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

 
 
 
 

19. #include
void func()
{
int x = 0;
static int y = 0;
x++; y++;
printf( ?%d ? %dn?, x, y );
}
int main()
{
func();
func();
return 0;
}
What will the code above print when it is executed?

 
 
 
 

20. long factorial (long x)
{
????
return x * factorial(x ? 1);
}
With what do you replace the ???? to make the function shown above return the correct answer?

 
 
 
 

21. What will be the output of the following statements ?
int i = 3;
printf(?%d%d?,i,i++);

 
 
 
 

22. main()
{
struct
{
int i;
}xyz;
(*xyz)->i=10;
printf(?%d?,xyz.i);
}
What is the output of this program?

 
 
 
 

23. What will be the output of the following statement ?
printf(?%X%x%ci%x?,11,10,?s?,12);

 
 
 
 

24. What is the output of the following code?
#include
void main()
{
int s=0;
while(s++<10)>
# define a 10
main()
{
printf(?%d..?,a);
foo();
printf(?%d?,a);
}
void foo()
{
#undef a
#define a 50
}

 
 
 
 

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

 
 
 
 

Question 1 of 25

Anil Computers

Anil Computers

Best computer Institute in Udaipur

Quiz_Anilcomputers1

सर्टिफिकेट  पाने के लिए अपने रिजल्ट का Screen shot नीचे दिये गये मोबाइल नम्बर पर send करें। Strictly call not allowed.