1. Question: What would be printed on the standard output as a result of the following code snippet?
    main()
    {
    enum {red, green, blue = 6, white};
    printf("%d %d %d %d", red, green, blue, white);
    return 0;
    }

    A
    0 1 6 2

    B
    0 1 6 7

    C
    Will result in Compilation Error

    D
    0 1 6 8

    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?
    main()
    {
        int a[5] = {1,4,5,6,9};
        printf("%d\t", *a);    //Line 1
        printf("%d", *++a);    //Line 2
    return 0;
    }

    A
    1 4

    B
    0 1

    C
    Undefined value

    D
    Compilation Error in "Line 1"

    E
    Compilation Error in "Line 2"

    Note: Not available
    1. Report
  3. Question: What would be printed on the standard output as a result of the following code snippet?
    #define max(a, b)((a) > (b)?(a):(b))
    main()
    {
    int a=4, c = 5;
    printf("%d ", max(a++, c++));
    printf("%d %d\n", a,c);
    }

    A
    Results in Compilation Error

    B
    6 4 5

    C
    6 5 7

    D
    6 5 6

    E
    None

    Note: Not available
    1. Report
  4. Question: Which of the following file modes would mean read + append?

    A
    w+

    B
    a+

    C
    r+

    D
    r+a

    E
    a+r

    Note: Not available
    1. Report
  5. Question: Which of the following standard functions is used to close a file?

    A
    fileclose()

    B
    closefile()

    C
    fclose()

    D
    All

    E
    None

    Note: Not available
    1. Report
  6. Question: What would be printed on the standard output as a result of the following code snippet?
    int Recur(int num)
    {
    if(num==1 || num==0)
    return 1;
    if(num%2==0)
    return Recur(num/2)+2;
    else
    return Recur(num-1)+3;
    }
    
    int main()
    {
            int a=9;
            printf("%d\n", Recur(a));
            return 0;
    }

    A
    10

    B
    9

    C
    11

    D
    8

    E
    None

    Note: Not available
    1. Report
  7. Question: Identify the incorrect statement.

    A
    Records can be defined in C by using structures

    B
    Structure members can be of the same/different data types

    C
    Memory is reserved when a structure label is defined

    D
    A pointer to a structure can be used to pass a structure to a function

    E
    Arrays of structures can be defined and initialized

    Note: Not available
    1. Report
  8. Question: What will happen when the following code is executed?
    {
    int num;
    num =0;
    do {-- num;
    printf("%d\n", num);
    num++;
    } while (num >=0);
    }

    A
    The loop will run infinitely

    B
    The program will not enter the loop

    C
    There will be a compilation error

    D
    A runtime error will be reported

    E
    None

    Note: Not available
    1. Report
  9. Question: Which of the following functions is used to extract formatted input from a file?

    A
    fputc()

    B
    fputs()

    C
    fprintf()

    D
    fscanf()

    E
    ftell()

    Note: Not available
    1. Report
  10. Question: What does the following function do?
    int fn(unsigned int x)
    {
            int count = 0;
            for(; x!=0; x&=(x-1))
                    count++;
            return count;
    }

    A
    Returns the minimum number of bits required to represent the number x

    B
    Returns the number of zero bits present in the number x

    C
    Returns the number of 1 bits(bits having one) in the number x

    D
    Returns the square root of the number

    E
    None

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