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

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
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
Compiler Error
0
1
2
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
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
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 i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
1
Compiler Error
syntax error
2
#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
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d", BLACK,BLUE,GREEN); }
no output
syntax error
0..1..2
compiler error
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
H
syntax error
compiler error
E
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
#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
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
main() { int i=5; printf(“%d” , i=++i ==6); }
5
1
6
Compiler Error
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
i=1
i=0
compiler error
syntax error
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
2..4
syntax error
compiler error
4..2
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

1404 days 8 minutes ago

Neeraj Singh

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

1725 days 18 hours 22 minutes ago

Monika

please provide the explainations

2110 days 3 hours ago

vikas

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

2940 days 18 hours 57 minutes ago

praveen

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

2947 days 17 hours 41 minutes ago

ankita leela

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

2954 days 21 hours 44 minutes ago

sugan s

please we need explanations for clarify the doubts

3023 days 22 hours 38 minutes ago

murugan

efficient and useful for interview person

3026 days 20 hours 53 minutes ago

murugan

efficient and useful for interview person

3026 days 20 hours 53 minutes ago

ravi Kumar

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

3200 days 16 hours 10 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