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. |
#include <stdio.h>int main(){int a[][3] = {1, 2, 3, 4, 5, 6};int (*ptr)[3] = a;printf("%d %d ", (*ptr)[1], (*ptr)[2]);++ptr;printf("%d %d\n", (*ptr)[1], (*ptr)[2]);return 0;}(A) 2 3 5 6(B) 2 3 4 5(C) 4 5 0 0(D) none of the above |
| Answer» | |
| 2. |
#include <stdio.h>#include <string.h>int main(){char a[] = {'G','E','E','K','S','Q','U','I','Z'};char b[] = "QUIZ";char c[] = "GEEKS";char d[] = "1234";int l = strlen(a);int o = printf("%d", sizeof((sizeof(l)+(c[5]+d[0]+a[1]+b[2]))) );printf("%c", a[o]);return 0;}Thanks to Gokul for contributing this question.(A) 4E(B) 8E(C) 1234Q(D) Compiler Dependent |
| Answer» | |
| 3. |
Assume that the size of an integer is 4 bytes. Predict the output?#include <stdio.h>int fun(){puts(" Hello ");return 10;}int main(){printf("%d", sizeof(fun()));return 0;}(A) 4(B) Hello 4(C) 4 Hello(D) Compiler Error |
| Answer» | |
| 4. |
Which of the following best describes C language(A) C is a low level language(B) C is a high level language with features that support low level programming(C) C is a high level language(D) C is a very high level language |
| Answer» | |
| 5. |
The C language is. (GATE CS 2002)(A) A context free language(B) A context sensitive language(C) A regular language(D) Parsable fully only by a Turing machine |
| Answer» None | |
| 6. |
In the C language (GATE CS 2002)(A) At most one activation record exists between the current activation record and the activation record for the main(B) The number of activation records between the current activation record and the activation record for the main depends on the actual function calling sequence.(C) The visibility of global variables depends on the actual function calling sequence.(D) Recursion requires the activation record for the recursive function to be saved on a different stack before the recursive function can be called. |
| Answer» | |
| 7. |
The number of tokens in the following C statement is (GATE 2000)printf("i = %d, &i = %x", i, &i);(A) 3(B) 26(C) 10(D) 21 |
| Answer» None | |