iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.41Hard

What is the output of this complex nested loop? for(int i = 1; i <= 2; i++) { for(int j = 1; j <= 2; j++) { if(i == j) continue; printf("%d%d ", i, j); } }

Q.42Hard

What is the output of: for(int i = 0; i < 2; i++) for(int j = 0; j < 2; j++) if(i == j) continue; printf("Done");

Q.43Hard

What will this code do? int i = 0; while(i < 5) { printf("%d ", i++); if(i == 3) break; }

Q.44Hard

Which statement best describes the 'dangling else' problem in C?

Q.45Hard

What is the output? for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) if(i == j) continue; printf("Done");

Q.46Hard

What will this code print? int x = 0; while(x < 3) { printf("%d ", x++); if(x == 2) continue; printf("X "); }

Q.47Hard

What will be printed? int i = 0, j = 0; for(i = 0; i < 3; i++) { for(j = 0; j < 3; j++) { if(i + j == 2) break; printf("%d%d ", i, j); } }

Q.48Hard

Consider the code: int sum = 0; for(int i = 1; i <= 10; i++) { if(i % 2 == 0) continue; sum += i; } printf("%d", sum); What will be printed?

Q.49Hard

How can you modify a variable inside a function and reflect the change in the calling function?

Q.50Hard

What is the output of this code? int* getPointer(int *p) { return p; } int main() { int a = 10; int *ptr = getPointer(&a); printf("%d", *ptr); }

Q.51Hard

What are static local variables in functions used for?

Q.52Hard

What will be the output? int counter() { static int count = 0; return ++count; } int main() { printf("%d ", counter()); printf("%d ", counter()); printf("%d", counter()); }

Q.53Hard

Which of the following is TRUE about inline functions in C99 standard?

Q.54Hard

What is function overloading in the context of C?

Q.55Hard

In C99 and later standards, what is the maximum number of parameters a function can have?

Q.56Hard

What is the primary advantage of using function pointers in C?

Q.57Hard

How does the volatile keyword affect function behavior in C?

Q.58Hard

What will happen if a recursive function has no base case?

Q.59Hard

Consider mutual recursion: void funcA(int n); void funcB(int n); funcA calls funcB and vice versa. What is required?

Q.60Hard

What is the correct way to return multiple values from a function in C?