C++ Programming
HEADER FILES USAGE MCQs
Total Questions : 8
Question 1.
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
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
Answer is Option A. -> 4
In this program, we are finding the average of first 10 numbers using stdarg header file
Output:
$ g++ std.cpp
$ a.out
4
Answer is Option B. -> fstream.h
In this fstream.h header file is used for accessing the files only.
Answer is Option B. -> iomanip.h
The iomanip header file is used to correct the precision of the values.
Answer is Option C. -> compile time error
In this program,we need to string header file to run this program.
Answer is Option C. -> declarations
In the header file, we define something that to be manipulated in the program.
Answer is Option A. -> iostream is a standard header and iostream.h is a non-standard header.
The iostream.h is used in the older versions of c++ and iostream is evolved from it in the std
namespace.
Answer is Option B. -> h
None.
Answer is Option A. -> include
The include keyword is used to include all the required things to execute the given code
in the program.
Recent Questions
Q. The Mortar In Which Both Cement And Lime Are Used As Binding....
Q. In....
Q. High Temperature In Gasification Of Coal Favours
Q. The __________ Engines Can Work On Very Lean Mixture Of Fuel....
Q. Ch....
Q. Purification Of Blood Takes Place In
Q. What Is The Minimum Vapour Pressure (in KPa) Of The Working ....
Q. The Kaposi’s Sarcoma Is Caused By ____________________
Q. Neutral Atmosphere Is Maintained In A/an __________ Furnace.....
Q. Raju Has 14 Currency Notes In His Pocket Consisting Of Only....
Q. " You Are Thinking Very Highly About Ravi But He Is Not....
Q. The Range Of Electromagnetic Spectrum Important In Heat Tran....
Q. Th....
Q. January : November : : Sunday : ?
Q. Consider The Following Statements.There Are 25 High Courts I....
Q. T....
Q. In Which Type Of Sedimentation, The Flocculent Suspension Of....
Q. Hardening Of Metal Is Due To Heating To A Particular Temper....
Q. Which Of The Following Materials Has The Highest Electrical ....
Q. ....