1. Question: What would be printed on the standard output as a result of the following code snippet?
    1. main()
    2. {
    3. int i=5;
    4. char option = 5;
    5. switch(option)
    6. {
    7. case '5':
    8. printf("case : 1 \n");
    9. break;
    10. case i:
    11. printf("case : 2 \n");
    12. break;
    13. default:
    14. printf("case : 3 \n");
    15. break;
    16. }
    17. return 0;
    18. }

    A
    case : 1

    B
    case : 2

    C
    case : 3

    D
    Result in compilation error

    E
    None

    Note: Not available
    1. Report
  2. Question: What would be printed on the standard output as a result of the following code snippet?
    1. #define func(t, a, b) { t temp; temp=a; a=b; b=temp; }
    2. main()
    3. {
    4. int a=3, b=4;
    5. float c=4.5, d = 5.99;
    6. func(int, a, b);
    7. func(float, c, d);
    8. printf("%d %d ", a, b);
    9. printf("%.2f %.2f\n", c, d);
    10. }

    A
    Results in Compilation Error

    B
    3 4 5.99 4.50

    C
    3 4 4.50 5.99

    D
    4 3 5.99 4.50

    E
    None

    Note: Not available
    1. Report
  3. Question: What would be printed on the standard output as a result of the following code snippet?
    1. main()
    2. {
    3. void addup (int b);
    4. addup(b);
    5. return 0;
    6. }
    7. int b = 5;
    8. void addup (int b)
    9. {
    10. static int v1;
    11. v1 = v1+b;
    12. printf("%d ", v1);
    13. }

    A
    Will result in Compilation Error

    B
    5

    C
    0

    D
    Undefined value

    E
    8

    Note: Not available
    1. Report
  4. Question: Given the following array declaration:
    1. int a[2][3][4];
    what would be the number of elements in array a?

    A
    24

    B
    22

    C
    20

    D
    12

    E
    36

    Note: Not available
    1. Report
  5. Question: Which file header is to be included for file handling in a C program?

    A
    string.h

    B
    file.h

    C
    stdio.h

    D
    stdlib.h

    E
    ctype.h

    Note: Not available
    1. Report
  6. Question: What is the return type of the following function declaration?
    1. func(char c);

    A
    void

    B
    char

    C
    int

    D
    undefined

    E
    syntax error

    Note: Not available
    1. Report
  7. Question: What is the return value in case a file is not opened successfully by using fopen()?

    A
    0

    B
    1

    C
    100

    D
    NULL

    E
    -1

    Note: Not available
    1. Report
  8. Question: What is the function to concatenate two strings?

    A
    strcmp()

    B
    strcpy()

    C
    strcat()

    D
    strlen()

    E
    catstr()

    Note: Not available
    1. Report
  9. Question: Which of the following statements is valid and correct?

    A
    char amessage[] = "lmnop"; amessage++;

    B
    char *pmessage = "abcde"; (*pmessage)++;

    C
    char amessage[] = "lmnop"; (*amessage)++;

    D
    char *pmessage = "abcde"; pmessage++;

    E
    None

    Note: Not available
    1. Report
  10. Question: What will be the output of following code?
    1. int main()
    2. {
    3. int i;
    4. i = 0;
    5. for (i = 1; i <2; i++)
    6. {
    7. i++;
    8. printf( "%d", i );
    9. continue;
    10. printf( "%d", i );
    11. }
    12. return 0;
    13. }

    A
    22

    B
    2,2

    C
    2

    D
    0

    E
    None

    Note: Not available
    1. Report
Copyright © 2025. Powered by Intellect Software Ltd