WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

C Language, a boon from Dennis Ritchie online Test

main() { main(); }
syntax error
Runtime error : Stack overflow.
Compiler Error
print some address
/
Compiler Error
no out put
syntax error
garbage value
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
Here value is 7
syntax error
Here value is 7.5
Compiler Error
main() { printf("%x",-1<<4); }
ffff
compiler error
fff0
0000
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
origin
Compiler error
originorgin
syntax error
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
556
655
565
555

void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
syntax error
Ok here
Compiler Error
Forget it
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
FALSE
TRUE
Compiler Error
syntax error
#define preprocessor command can be used for defining
macros
for loops
Symbolic constants
Both (1) and (2)

main() { int i=_l_abc(10) ; printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
Compiler Error
11
10
9
main() { char a[4]="HELLO"; printf("%s",a); }
Compiler error: Too many initializers
some garbage value
syntax error
no out put
void main() { unsigned giveit=-1; int gotit; printf("%u",++giveit); printf("%u \n",gotit=--giveit); }
syntax
0
Compiler
00
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
syntax error
behaviour is implementation dependent
Compiler Error
no out put
#include main() { char s[]={'a','b','c','\n','c','\0'}; Char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
77
88
compiler error
syntax error
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }
syntax error
Compiler Error: switch expression not integral
some garbage value
no out put
Description:

This test of System software is based on C Language
Disclaimer: Content, such as images used in the questions (if any), have been picked up from various places for the sole purpose of Instruction.

Comments
Manoj
By: Manoj
789 days 6 hours 36 minutes ago

It should give compilation error for redecalartion of cptr;

ravi
By: ravi
509 days 19 hours 24 minutes ago

you must check Que2 , because there is redeclaration of cptr.
and your Que5 will give ans :
origin is(00)
origin is(00) thats why there is no error
and as in Que6
there is an error but u don't give even a option.

ravi
By: saobang972
413 days 5 hours 45 minutes ago

I agree with you. Q6 was WRONG. and the Q7, the result must be "Ok here"
In Q13. after execute for loop. because you init i as char. So the max value will be 255. after that i will be over this is the cause the for loop stop. my compiler(Dev-C) don't display any error.

raheesa
By: raheesa
480 days 8 hours 6 minutes ago

plz explain Q14

abhinav
By: abhinav
368 days 19 hours 50 minutes ago

u fucker first clear the c concepts.......then post the test.............ur answer for q 12 is wrong...............and ans of q2 is also wrong

sushmitha
By: sushmitha
355 days 39 minutes ago

can any one explain the 5th qsn

Devendra dattatraya dahiphale
By: Devendra dattatraya dahiphale
348 days 1 hours 24 minutes ago

good

Want to learn?

Sign up and browse through relevant courses.

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


Area code Number
Subject 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

Your Facebook Friends on WizIQ

More Tests By Author

ASP Server Controls
10 Questions | 227 Attempts

ASP.NET, Namespaces ASP.NET
10 Questions | 855 Attempts

An ASP.NET Application
10 Questions | 173 Attempts

Test your basic knowledge on DATASTRUCTURES, STACK
10 Questions | 410 Attempts