Test your C knowledge attent these questions.

ARE YOU EXPERT IN C LANGUAGE ATTENT THE FOLLOWING TEST

Try to answer the following questions

1. Main()
{
Char string[]=”Hello World”;
Display(string);
}
Void display(char *string)
Printf(“%s”,string);
}

2. Main()
{I
nt c=- -2;
Printf(“c=%d”,c);
}

3. #define int char
Main()
{
Int i=65;
Printf(“sizeof(i)=%d”,sizeof(i));
}

4. Main()
{
Float me=1.1;
Double you=1.1;
If(me==you)
Printf(“Print anyone your flower name”);
Else
Printf(“Print any favourite animal name”);
}

5. Main()
{
Int i=-1,j=-1,k=0,l=2,m;
M=i++&&j++&&k++||i++;
Printf(“%d%d%d%d%d”,i,j,k,l,m);
}

6. Main()
{
Int i=0;
For(;i++;printf(“%d”,i));
Printf(“%d”,i);
}

7. Main()
{
Printf(“%x”,-4<<4);
}

8. Main()
{
Char string[]=”Hello world”;
Display(string);
}
Void display(char *string)
{
Printf(“%s”,string);
}

9. #include<stdio.h>
Main()
{
Int a[3][4]={1,2,3,4,4,3,2,1,7,8,9,0};
Printf(“”\n%u%u”,a+1,&a+1);
}

10.Main()
{
Char s[ ]=”man”;
Int i;
For(i=0;s[ i ];i++)
Printf(“\n%c%c%c%c”,s[ i ],*(s+i),*(i+s),i[s]);
}

11.Main()
{
Static int var=5;
Printf(“%d”,var--);
If(var)
Main();
}

12.#include<stdio.h>
Main()
{
Struct xx
{
Int x;
Struct yy
{
Char s;
Struct xx *p;
};Struct yy *q;
};
}

13.Main()
{
Printf(“\nab”);
Printf(“\bsi”);
Printf(“\rha”);
}

14.#define square(x)x*x
Main()
{
Int i;
I=64/square(4);
Printf(“%d”,i);
}

15.Main()
{
Clrscr();
}
Clrscr()

16.Main()
{I
nt i=400,j=300;
Printf(“%d..%d”);
}

17.Main()
{
Int i=1;
While(i<=5)
{
Printf(“%d”,i);
If(i>2)
Goto here;
I++;
}}
Fun()
{
Here:
Printf(“pp”);
}

18.Void main()
{I
nt i=5;
Printf(“%d”,i+++++i);
}

19.Main()
{
Char *p;
Printf(“%d %d”,sizeof(*p),sizeof(p));
}

20.Void main()
{I
nt const * p=5;
Printf(“%d”,++(*p));
}

21.Main()
{I
nt i=3;
For(;i++=0;)printf(“%d”,i);
}

22.What is an lvalue?

23.What does static variable mean?

24.Void main()
{
Static int i;
While(i<=10)
(i>2)?i++:i--;
Printf(“%d”,i);
}

25.Main()
{I
nt i=10,j=20;
J = i,j?(i,j)?i:j:j;
Printf(“%d %d”,i,j);
}

26.Main()
{
Int i=5,j=10;
I=i&=j&&10;
Printf(“%d %d”,i,j);
}

if you complete these questions please mail me i will send you the correct answers. don't feel it tough,

 

No comments: