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.

Comments
vignesh ejil
By: vignesh ejil
623 days 4 hours 32 minutes ago

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

vignesh ejil
By: Pruthwiraj Ghadge
620 days 14 hours 8 minutes ago

alright I will keep it in mind next time. i am designing some new tests so be in touch and keep testing...

anju joshi
By: anju joshi
622 days 8 hours 21 minutes ago

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

anju joshi
By: Pruthwiraj Ghadge
620 days 14 hours 9 minutes ago

alright I will keep it in mind next time. i am designing some new tests so be in touch and keep testing...

manoj singh
By: manoj singh
622 days 8 hours 15 minutes ago

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

manoj singh
By: Pruthwiraj Ghadge
620 days 14 hours 9 minutes ago

alright I will keep it in mind next time. i am designing some new tests so be in touch and keep testing...

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Pruthwiraj Ghadge
Logic building is the Key to Programmming
User
42 Followers

Your Facebook Friends on WizIQ

More Tests By Author

DBMS and SQL Basics
20 Questions | 1400 Attempts

HTML QUIZ
20 Questions | 770 Attempts

C Programming Test
10 Questions | 428 Attempts

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect