1. Question: What would be printed on the standard output as a result of the following code snippet?
    main()
    {
            int i=5;
            char option = 5;
            switch(option)
            {
                    case '5':
                                    printf("case : 1 \n");
                                    break;
                    case i:
                                    printf("case : 2 \n");
                                    break;
                    default:
                                    printf("case : 3 \n");
                                    break;
            }
            return 0;
    }

    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?
    #define func(t, a, b) { t temp; temp=a; a=b; b=temp; }
    main()
    {
            int a=3, b=4;
            float c=4.5, d = 5.99;
            func(int, a, b);
            func(float, c, d);
            printf("%d %d ", a, b);
            printf("%.2f %.2f\n", c, d);
    }

    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?
    main()
    {
            void addup (int b);
                    addup(b);
            return 0;
    }
    int b = 5;
    void addup (int b)
    {
            static int v1;
            v1 = v1+b;
            printf("%d ", v1);
    }

    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:
    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?
    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?
    int main()
       {
          int i;
          i = 0;
          for (i = 1; i <2; i++)
          {
              i++;
              printf( "%d", i );
              continue;
              printf( "%d", i );
          }
          return 0;
       }

    A
    22

    B
    2,2

    C
    2

    D
    0

    E
    None

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