Basics of C Online Test

How many byte of memory an Integer takes?


What will be printed as the result of the operation below:

#define swap(a,b) a=a+b;b=a-b;a=a-b;

void main()

{

int x=5, y=10;

swap (x,y);

printf(“%d %dn”,x,y);

swap2(x,y);

printf(“%d %dn”,x,y);

}

int swap2(int a, int b)

{

int temp;

temp=a;

b=a;

a=temp;

return 0;

}


What will be printed as the result of the operation below:

main()

{

int x=5;

printf(“%d,%d,%dn”,x,x< <2,x>>2);

}


Predict the output or error(s) for the following:

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

}


Predict the output or error(s) for the following:

void main()

{

int const * p=5;

printf("%d",++(*p));

}
















































Description:

This is a very simple test of C basics.
You can test how good you are at the C basics.

Discussion

manoj singh

Both opinion are correct iread 4 que clearly and they were correct.

4266 days 21 hours 44 minutes ago

anju joshi

gud test..i agree with vignesh,if the clarity is gud we feel lik givin tests..

4266 days 21 hours 50 minutes ago

vignesh ejil

give the programs clearly..........so that it will be easy for us to ans it.....and keep many practice test like this!!

4267 days 18 hours 1 minutes ago

Pruthwiraj Ghadge
Logic building is the Key to Programmming
User
59 Followers

Your Facebook Friends on WizIQ

More Tests By Author

DBMS and SQL Basics
20 Questions | 5491 Attempts

HTML QUIZ
20 Questions | 19377 Attempts

C Programming Test
10 Questions | 1031 Attempts