Choose a topic to test your knowledge and improve your C/C skills
What is the output of this C code? int main() { void foo(), f(); f(); } void foo() { printf("2 "); } void f() { printf("1 "); foo(); }
What is the output of this C code? int main() { void foo(); void f() { foo(); } f(); } void foo() { printf("2 "); }
What is the output of this C code? void foo(); int main() { void foo(); foo(); return 0; } void foo() { printf("2 "); }
What is the output of this C code? void foo(); int main() { void foo(int); foo(1); return 0; } void foo(int i) { printf("2 "); }
What is the output of this C code? void m() { printf("hi"); } void main() { m(); }
What is the output of this C code? void m() { printf("hi"); } void main() { m(); }
What is the output of this C code? void m(); void n() { m(); } void main() { void m() { printf("hi"); } }
What is the output of this C code? void main() { m(); void m() { printf("hi"); } }
What is the output of this C code? void main() { m(); } void m() { printf("hi"); m(); }
What is the output of this C code? void main() { static int x = 3; x++; if (x <= 5) { printf("hi"); main(); } }
Which of the following function declaration is illegal?
Which function definition will run correctly?
Can we use a function as a parameter of another function? [ Eg: void wow(int func()) ]
The value obtained in the function is given back to main by using ________ keyword?
What is the return-type of the function sqrt()
Which of the following function declaration is illegal?
What is the output of this code having void return-type function? void foo() { return 1; } void main() { int x = 0; x = foo(); printf("%d", x); }
What will be the data type returned for the following function? int func() { return (double)(char)5.0; }
What is the problem in the following declarations? int func(int); double func(int); int func(float);
The output of the code below is void main() { int k = m(); printf("%d", k); } void m() { printf("hello"); }
The output of the code below is int *m() { int *p = 5; return p; } void main() { int *k = m(); printf("%d", k); }
The output of the code below is int *m(); void main() { int *k = m(); printf("hello "); printf("%d", k[0]); } int *m() { int a[2] = {5, 8}; return a; }
The output of the code below is int *m(); void main() { int k = m(); printf("%d", k); } int *m() { int a[2] = {5, 8}; return a; }
The output of the code below is void m(int k) { printf("hi"); } void m(double k) { printf("hello"); } void main() { m(3); }
What is the default return type if it is not specified in function definition?
What is the output of this C code? int foo(); int main() { int i = foo(); } foo() { printf("2 "); return 2; }
What is the output of this C code? double foo(); int main() { foo(); return 0; } foo() { printf("2 "); return 2; }
functions can return structure in c?
functions can return enumeration constants in c?
What is the output of this C code? void main() { m(); printf("%d", x); } int x; void m() { x = 4; }
What is the output of this C code? int x; void main() { printf("%d", x); }
What is the output of this C code? int x = 5; void main() { int x = 3; printf("%d", x); { x = 4; } printf("%d", x); }
What is the output of this C code? int x = 5; void main() { int x = 3; printf("%d", x); { int x = 4; } printf("%d", x); }
Functions in C are ALWAYS:
Which of the following are an external variable? int func (int a) { int b; return b; } int main() { int c; func (c); } int d;
What will be the output? int main() { printf("%d", d++); } int d = 10;
What will be the output? double var = 8; int main() { int var = 5; printf("%d", var); }
What is the output of this C code? double i; int main() { printf("%g ",i); return 0; }
Which part of the program address space is p stored in the code given below? int *p; int main() { int i = 0; p = &i; return 0; }
Can variable i be accessed by functions in another source file? int i; int main() { printf("%d ", i); }
Property of external variable to be accessed by any source file is called by C90 standard as:
What is the output of this C code? int *i; int main() { if (i == NULL) printf("true "); return 0; }
What is the output of this C code? int *i; int main() { if (i == 0) printf("true "); return 0; }
What is the output of this C code? static int x = 5; void main() { x = 9; { int x = 4; } printf("%d", x); }
What is the output of this C code? void main() { m(); m(); } void m() { static int x = 5; x++; printf("%d", x); }
What is the output of this C code? void main() { static int x; printf("x is %d", x); }
What is the output of this C code? static int x; void main() { int x; printf("x is %d", x);
What is the output of this C code? void main() { static double x; int x; printf("x is %d", x); }
What is the output of this C code? void main() { static int x; if (x++ < 2) main(); }
Which of following is not accepted in C?
Which of the following cannot be static in C?
The scope of an automatic variable is:
Automatic variables are allocated space in the form of a:
Which of the following is a storage specifier?
Default storage class if not any is specified for a local variable, is auto:
Automatic variables are stored in:
What linkage does automatic variables have?
What is the output of this C code? int main() { auto i = 10; const auto int *p = &i; printf("%d ", i); }