InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
int main(){int x = 032;printf("%d", x);return 0;}(A) 32(B) 0(C) 26(D) 50 |
| Answer» | |
| 2. |
#include <stdio.h>extern int var;int main(){var = 10;printf("%d ", var);return 0;}(A) Compiler Error: var is not defined(B) 20(C) 0 |
| Answer» | |
| 3. |
Consider the following C program, which variable has the longest scope?int a;int main(){int b;// ..// ..}int c;(A) a(B) b(C) c(D) All have same scope |
| Answer» | |
| 4. |
Predict the output#include <stdio.h>int var = 20;int main(){int var = var;printf("%d ", var);return 0;}(A) Garbage Value(B) 20(C) Compiler Error |
| Answer» | |
| 5. |
#include <stdio.h>extern int var = 0;int main(){var = 10;printf("%d ", var);return 0;}(A) 10(B) Compiler Error: var is not defined(C) 0 |
| Answer» | |
| 6. |
Consider the following two C linesint var1;extern int var2;Which of the following statements is correct(A) Both statements only declare variables, don’t define them.(B) First statement declares and defines var1, but second statement only declares var2(C) Both statements declare define variables var1 and var2 |
| Answer» | |
| 7. |
Output?int main(){{int var = 10;}{printf("%d", var);}return 0;}(A) 10(B) Compiler Error(C) Garbage Value |
| Answer» | |