Header Files Usage

1

What is the output of this program?

1.
    #include 
2.
    #include 
3.
    using namespace std;
4.
    float avg( int Count, ... )
5.
    {
6.
        va_list Numbers;
7.
        va_start(Numbers, Count);
8.
        int Sum = 0;
9.
        for (int i = 0; i < Count; ++i)
10.
            Sum += va_arg(Numbers, int);
11.
        va_end(Numbers);
12.
        return (Sum/Count);
13.
    }
14.
    int main()
15.
    {
16.
        float Average = avg(10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
17.
        cout << Average;
18.
        return 0;
19.
    }
A. 4
B. 5
C. 6
D. compile time error

2

Which of the following header files is required for creating and reading data files?

A. ofstream.h
B. fstream.h
C. ifstream.h
D. console.h

3

setprecision requires which of the following header file?

A. stdlib.h
B. iomanip.h
C. console.h
D. conio.h

4

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    int main()
4.
    {
5.
        char name[30];
6.
        cout << "Enter name: ";
7.
        gets(name);
8.
        cout << "Name: ";
9.
        puts(name);
10.
        return 0;
11.
    }
A. jobsjobs
B. jobs
C. compile time error
D. program will not run

5

What does a default header file contain?

A. prototype
B. implementation
C. declarations
D. none of the mentioned