1. Question: What does the following declaration mean? int (*ptr)[10];

    A
    ptr is array of pointers to 10 integers

    B
    ptr is a pointer to an array of 10 integers

    C
    ptr is an array of 10 integers

    D
    ptr is an pointer to array

    Note: Not available
    1. Report
  2. Question: In C, if you pass an array as an argument to a function, what actually gets passed?

    A
    Value of elements in array

    B
    First element of the array

    C
    Base address of the array

    D
    Address of the last element of array

    Note: Not available
    1. Report
  3. Question: In a file contains the line "I am a boy\r\n" then on reading this line into the array str using fgets(). What will str contain?

    A
    "I am a boy\r\n\0"

    B
    "I am a boy\r\0"

    C
    "I am a boy\n\0"

    D
    "I am a boy"

    Note: Not available
    1. Report
  4. Question: What is the purpose of "rb" in fopen() function used below in the code?
    FILE *fp;
    fp = fopen("source.txt", "rb");

    A
    open "source.txt" in binary mode for reading

    B
    open "source.txt" in binary mode for reading and writing

    C
    Create a new file "source.txt" for reading and writing

    D
    None of above

    Note: Not available
    1. Report
  5. Question: What does fp point to in the program ?
    #include<stdio.h>
    int main()
    {
        FILE *fp;
        fp=fopen("trial", "r");
        return 0;
    }

    A
    The first character in the file

    B
    A structure which contains a char pointer which points to the first character of a file.

    C
    The name of the file.

    D
    The last character in the file.

    Note: Not available
    1. Report
  6. Question: Which of the following operations can be performed on the file "NOTES.TXT" using the below code?
    FILE *fp;
    fp = fopen("NOTES.TXT", "r+");

    A
    Reading

    B
    Writing

    C
    Appending

    D
    Read and Write

    Note: Not available
    1. Report
  7. Question: To print out a and b given below, which of the following printf() statement will you use?
    #include<stdio.h>
    float a=3.14;
    double b=3.14;

    A
    printf("%f %lf", a, b);

    B
    printf("%Lf %f", a, b);

    C
    printf("%Lf %Lf", a, b);

    D
    printf("%f %Lf", a, b);

    Note: Not available
    1. Report
  8. Question: In the following code, the P2 is Integer Pointer or Integer?
    typedef int *ptr;
    ptr p1, p2;

    A
    Integer

    B
    Integer pointer

    C
    Error in declaration

    D
    None of above

    Note: Not available
    1. Report
  9. Question: In the following code what is 'P'?
    typedef char *charp;
    const charp P;

    A
    P is a constant

    B
    P is a character constant

    C
    P is character type

    D
    None of above

    Note: Not available
    1. Report
  10. Question: In the following code what is 'P'?
    typedef char *charp;
    const charp P;

    A
    P is a constant

    B
    P is a character constant

    C
    P is character type

    D
    None of above

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