kaldin

  • Login

C Programming


1) Which of the following errors would be reported by the compiler on compiling the program given below?

#include<stdio.h>
int main()
{
    int a = 5;
    switch(a)
    {
    case 1:
    printf("First");

    case 2:
    printf("Second");

    case 3 + 2:
    printf("Third");

    case 5:
    printf("Final");
    break;

    }
    return 0;
}
  • A)

  • B)

  • C)

  • D)

Next
Show Answer:
Show Answer


More Question
How many times the while loop will get executed if a short int is 2 byte wide #includestdio.hint main() int j=1; while(j = 255) printf(c d\n, j, j); j++; return 0;
Which of the following statements are correct about the function long fun(int num) int i; long f=1; for(i=1; i=num; i++) f = f i; return f;
What will be the output of the program #includestdio.hint main() char c=48; int i, mask=01; for(i=1; i=5; i++) printf(c, cmask); mask = mask1; return 0;
What will be the output of the program #includestdio.hint main() int i=4, j=8; printf(d, d, d\n, ij&ji, ij&ji, i^j); return 0;
Which of the following statements are correct about an array 1: The array int num[26]; can store 26 elements.2: The expression num[1] designates the very first element in the array.3: It is necessary to initialize the array at the time of declaration.4: The declaration num[SIZE] is allowed if SIZE is a macro.