Explore topic-wise InterviewSolutions in .

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.

Output?#include <stdio.h>int fun(){static int num = 16;return num--;}int main(){for(fun(); fun(); fun())printf("%d ", fun());return 0;}(A) Infinite loop(B) 13 10 7 4 1(C) 14 11 8 5 2(D) 15 12 8 5 2

Answer» None
2.

#include <stdio.h>int main(){int x = 10;static int y = x;if(x == y)printf("Equal");else if(x > y)printf("Greater");elseprintf("Less");return 0;}(A) Compiler Error(B) Equal(C) Greater(D) Less

Answer»
3.

#include<stdio.h>int main(){typedef int *i;int j = 10;i *a = &j;printf("%d", **a);return 0;}(A) Compiler Error(B) Garbage Value(C) 10(D) 0

Answer»
4.

Output of following program#include <stdio.h>int fun(int n){static int s = 0;s = s + n;return (s);}int main(){int i = 10, x;while (i > 0){x = fun(i);i--;}printf ("%d ", x);return 0;}(A) 0(B) 100(C) 110(D) 55

Answer»
5.

#include <stdio.h>char *fun(){static char arr[1024];return arr;}int main(){char *str = "geeksforgeeks";strcpy(fun(), str);str = fun();strcpy(str, "geeksquiz");printf("%s", fun());return 0;}(A) geeksforgeeks(B) geeksquiz(C) geeksforgeeks geeksquiz(D) Compiler Error

Answer» None