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.

Discussion

Ravi

this output is not currect

1622 days 3 hours 47 minutes ago

Neeraj Singh

To get the explanation of these questions visit http://www.maestrotutorial.com/
and contact us.

1943 days 22 hours 1 minutes ago

Monika

please provide the explainations

2328 days 6 hours 39 minutes ago

vikas

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

3158 days 22 hours 37 minutes ago

praveen

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

3165 days 21 hours 21 minutes ago

ankita leela

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

3173 days 1 hours 23 minutes ago

sugan s

please we need explanations for clarify the doubts

3242 days 2 hours 18 minutes ago

murugan

efficient and useful for interview person

3245 days 32 minutes ago

murugan

efficient and useful for interview person

3245 days 32 minutes ago

ravi Kumar

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

3418 days 19 hours 50 minutes ago

Your Facebook Friends on WizIQ

More Tests By Author

ASP Server Controls
10 Questions | 667 Attempts

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

An ASP.NET Application
10 Questions | 437 Attempts