C Language, a boon from Dennis Ritchie & Bell Labs online Test

void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
2..4
syntax error
compiler error
4..2
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
i=1
i=0
compiler error
syntax error
main() { int i=5; printf(“%d” , i=++i ==6); }
5
1
6
Compiler Error
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++) { printf(" %d ",*p); ++p; } }
syntax error
compiler error
2 2 2 2 2 2 3 4 6 5
5 6 4 5 2 2 2 2
#include main() { struct xx { int x=3; Char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }
syntax error
no output
Compiler Error
Hello
void main() { printf(“sizeof (void *) = %d \n”, sizeof(void*)); printf(“sizeof (int *) = %d \n”, sizeof(int*)); printf(“sizeof (double *) = %d \n”, sizeof(double*)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }
no out put
Compiler Error
sizeof (void *) = 2 sizeof (int *) = 2 sizeof (double *) = 2 sizeof(struct unknown *) = 2
syntax error
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
H
syntax error
compiler error
E
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d", BLACK,BLUE,GREEN); }
no output
syntax error
0..1..2
compiler error
#include char *someFun1() { char temp[ ] = "string"; return temp; } char *someFun2() { char temp[ ] = {'s','t','r','i','n','g'}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
syntax error
some garbage value
Compiler Error
no out put
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
1
Compiler Error
syntax error
2
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
Compiler Error
syntax error
10
1
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
Compiler error: Cannot increment a void pointer
syntax error
memory address
no out put
Recursive functions are executed in a
Last in First out order
First in First out order
Are maintained in a stack
None of the above
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
Compiler Error
0
1
2
main() { int i = 3; for ( ; i++=0 ;) printf(“%d”,i); }
Compiler error: Lvalue required in function main
syntax error
some garbage value
no out put
Description:

This test is designed to help the students to assess their level of knowledge in 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
ghostkadost
By: ghostkadost
1305 days 8 hours 45 minutes ago

No body uses 16 bit compiler anymore so please refrain from using FAR pointer and associating sizeof pointer as 2 bytes.

Nick
By: Nick
1300 days 7 hours 24 minutes ago

It seems some answers are not correct....

chidambaram
By: chidambaram
1259 days 9 hours 47 minutes ago

good for basic testing

singaravelan
By: singaravelan
1212 days 16 hours 17 minutes ago

some of the answers are not correct...

deepak
By: deepak
1211 days 5 hours 28 minutes ago

explanations must be there it will help in clearing our concept......deepak choudhary BE IT

deepak
By: rajni
379 days 7 hours 25 minutes ago

but here is no explanations......help me

deepak
By: rajni
379 days 7 hours 25 minutes ago

but here is no explanations......help me

krishna
By: krishna
1204 days 10 hours 53 minutes ago

good questions to test..thanku

Pallavi
By: Pallavi
1200 days 12 hours 43 minutes ago

its good

ism_9242
By: ism_9242
1198 days 12 hours 20 minutes ago

it is good but when we are reviewing the answers explanations it is not comming.

ajay rajpoot
By: ajay rajpoot
1193 days 9 hours 39 minutes ago

its really good

Anjana
By: Anjana
1188 days 7 hours 9 minutes ago

hi..It will be better if u explain the right answers

jayagobinathan
By: jayagobinathan
1187 days 14 hours 26 minutes ago

It's good to improve the skills

kalarani
By: kalarani
1167 days 10 hours 12 minutes ago

it seems like considerable amount of answers r wrong..

Bill
By: Bill
1161 days 10 hours 3 minutes ago

Sucks.... Please next time try to compile your code first. Also define some information of environment, such as data types size.

mohammed
By: mohammed
1141 days 22 hours 28 minutes ago

question 2 is wrong answered and the right answer is i = 0
and question 8 is wrong answered and it's answer would be a compilation error, and finally question 14 is wrong answered or it's not clear. other than that it's a good exam.

mohammed
By: aadhib
875 days 14 hours 11 minutes ago

no q2 is correct..i try that one

vignesh
By: vignesh
1131 days 5 hours 57 minutes ago

answer explanation is not coming properly..
good test

Veeksha .A.V
By: Veeksha .A.V
1091 days 5 hours 5 minutes ago

the explanation for the answers is not there .please send the explanation.

baskaran
By: baskaran
1074 days 13 hours 45 minutes ago

it s very useful to me

DN
By: DN
1071 days 3 hours 9 minutes ago

For Q6 the struct unknown is not declared so you can have either error or valid printf..

sajid
By: sajid
1070 days 7 hours 52 minutes ago

Where we can find the explanations..its boring without that

@nyl kr
By: @nyl kr
1053 days 8 hours 28 minutes ago

In fact i found this test worthy even after some problems!!!!.

vinod
By: vinod
1051 days 3 hours 42 minutes ago

you are repeating the same questions

vinod
By: vinod
1049 days 4 hours 53 minutes ago

not yet satisfied

para srish
By: para srish
1044 days 12 hours 28 minutes ago

i want the explanation for 6,7,9,10,11,14..as i dint find it ok!!

para srish
By: para srish
1044 days 12 hours 22 minutes ago

i found that this test is worth while appearing and its question content is good enough!!

laxmimanu0007
By: laxmimanu0007
1038 days 11 hours 32 minutes ago

to learn how to start

kirthika
By: kirthika
1037 days 8 hours 53 minutes ago

can u pls teel hoe this ans comes

jagadeesh
By: jagadeesh
1037 days 1 hours 31 minutes ago

not mentioned which compiler it is...

raja
By: raja
999 days 9 hours 20 minutes ago

anyway i enjoyed it....thanks

vicky
By: vicky
997 days 1 hours 28 minutes ago

Kindly check the first question. I think the answer should be syntax error...

siva
By: siva
915 days 8 hours 26 minutes ago

good 2 improve our knowledge

ravi Kumar
By: ravi Kumar
886 days 43 minutes ago

any body can tell me hows int i=5 printf("%d",i= i==6);
output is 1 ? plz help.

ravi Kumar
By: sami
885 days 22 hours 21 minutes ago

do you mean (i= i==6)..

(i= i == 6) will be evaluated as (i=6) == 6).. here i=6 is assignemt
operation so result will be the value assigned i.e. 6 so its same as
(6==6) which is a comparision operation. since 6==6 its true i.e. 1 it prints "1".

ravi Kumar
By: sami
885 days 22 hours 19 minutes ago

sorry increment operator is not getting printed in html.. read the
expression as (i=i plus plus == 6).

ravi Kumar
By: vikas singh
272 days 9 hours 35 minutes ago

by hierarchy of operator hear

firstly perform assignment operator (=) {right to left}
so i=6

and then perform equal operator (==) {left to right}
hence i==6 that is true

hence the output is 1

murugan
By: murugan
712 days 5 hours 25 minutes ago

efficient and useful for interview person

murugan
By: murugan
712 days 5 hours 25 minutes ago

efficient and useful for interview person

sugan s
By: sugan s
709 days 7 hours 11 minutes ago

please we need explanations for clarify the doubts

ankita leela
By: ankita leela
640 days 6 hours 16 minutes ago

its very useful for us, thank u.But explanation is also required

praveen
By: praveen
633 days 2 hours 14 minutes ago

thanks a lot............

vikas
By: vikas
626 days 3 hours 30 minutes ago

the worst test i have ever faced..some answers of the questions is not given in a option..reallly dumbooo...

Want to learn?

Sign up and browse through relevant courses.

or fill this simple form
Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as shown 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 | 425 Attempts

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

An ASP.NET Application
10 Questions | 290 Attempts

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

Connect