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 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
}

 
 
 
 

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

 
 
 
 

3. 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?

 
 
 
 

4. 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);

 
 
 
 

5. #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?

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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 program ?
#include
void main()
{
int a = 36, b = 9;
printf(?%d?,a>>a/b-2);
}

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

23. 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]);

 
 
 
 

24. 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?

 
 
 
 

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

 
 
 
 

Question 1 of 25

Anil Computers

Anil Computers

Best computer Institute in Udaipur

Quiz_Anilcomputers1

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