LakshyaEducation.in

VEDIC MATHS Video Series
  • Home
  • Video Series
    • Vedic Maths Videos
    • Quantitative Aptitude Videos
    • Class 8 Maths Videos
    • Class 9 Maths Videos
    • Class 10 Maths Videos
  • Quiz & Solutions
  • Blog
  • Store
  • Login
  • Contact Us
  • Home
  • Topic
  • C++ Programming
  • Header Files Usage

C++ Programming

HEADER FILES USAGE MCQs

Total Questions : 8

Question 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
  1.    4
  2.    5
  3.    6
  4.    compile time error
 Discuss Question
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

Question 2.

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



  1.    ofstream.h
  2.    fstream.h
  3.    ifstream.h
  4.    console.h
 Discuss Question
Answer is Option B. -> fstream.h

In this fstream.h header file is used for accessing the files only.

Question 3.

setprecision requires which of the following header file?


  1.    stdlib.h
  2.    iomanip.h
  3.    console.h
  4.    conio.h
 Discuss Question
Answer is Option B. -> iomanip.h

The iomanip header file is used to correct the precision of the values.

Question 4.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
char name[30];
6.
cout
  1.    jobsjobs
  2.    jobs
  3.    compile time error
  4.    program will not run
 Discuss Question
Answer is Option C. -> compile time error

In this program,we need to string header file to run this program.

Question 5.

What does a default header file contain?


  1.    prototype
  2.    implementation
  3.    declarations
  4.    none of the mentioned
 Discuss Question
Answer is Option C. -> declarations

In the header file, we define something that to be manipulated in the program.

Question 6.

Identify the incorrect statement.


  1.    iostream is a standard header and iostream.h is a non-standard header.
  2.    iostream is a non-standard header and iostream.h is a non-standard header.
  3.    iostream is a standard header and iostream.h is a standard header.
  4.    none of the mentioned
 Discuss Question
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.

Question 7.

What is the user-defined header file extension in c++?


  1.    cpp
  2.    h
  3.    hf
  4.    none of the mentioned
 Discuss Question
Answer is Option B. -> h

None.

Question 8.

Which of the following keyword is used to declare the header file?


  1.    include
  2.    exclude
  3.    string
  4.    namespace
 Discuss Question
Answer is Option A. -> include

The include keyword is used to include all the required things to execute the given code 

in the program.

  • Share on Facebook!
  • Share on Pinterest!

Sub Topics

  • Abstract Classes
  • Access Control
  • Argument Passing
  • Arrays
  • Booleans
  • C++ Concepts
  • Catching Exceptions
  • Character Types
  • Class Hierarchies And Abstract Classes
  • Class Hierarchies Introduction
  • Classes
  • Comments And Indentation
  • Complex Number Type
  • Constants
  • Constructors And Destructors
  • Container Design
  • Conversion Operators
  • Declaration
  • Default Arguments
  • Dereferencing
  • Derivation And Templates
  • Derived Classes
  • Design Of Class Hierarchies
  • Enumerations
  • Error Handling
  • Error Handling Alternatives
  • Essential Operators
  • Exception Specifications
  • Exceptions
  • Exceptions And Efficiency
  • Exceptions That Are Not Errors
  • Floating Point Types
  • Free Store
  • Friends
  • Function Call
  • Function Declarations
  • Function Templates
  • Functions
  • Grouping Of Exceptions
  • Header Files Usage
  • Increment And Decrement
  • Integer Types
  • Large Objects
  • Linkage
  • Macros
  • Modularization And Interfaces
  • Multiple Inheritance
  • Namespaces
  • Objects
  • Objects And Classes
  • Oops Concepts
  • Operator Functions
  • Operators
  • Overloaded Function Names
  • Pointer To Function
  • Pointer To Void
  • Pointers
  • Pointers Into Arrays
  • Pointers To Members
  • References
  • Resource Management
  • Run Time Type Information
  • Sequence Adapters
  • Sequences
  • Simple String Template
  • Sizes
  • Specialization
  • Standard Exceptions
  • Standard Library Design
  • Statements
  • String Class
  • Structures
  • Subscripting
  • Template Arguments To Specify Policy Usage
  • Types
  • Uncaught Exceptions
  • Unspecified Number Of Arguments
  • User Defined Types
  • Value Return
  • Vector
  • Void

Topics

  • Computer Aptitude
  • SAIL Junior Officer (E-0)
  • 10th Grade
  • 11th Grade
  • 12th Grade
  • 4th Grade
  • 5th Grade
  • 6th Grade
  • 7th Grade
  • 8th Grade
  • 9th Grade
  • NCERT
  • Cat
  • Commerce
  • Computer Science
  • Engineering
  • English
  • General Knowledge
  • Ias
  • Management
  • Quantitative Aptitude
  • Reasoning Aptitude
  • General Studies (Finance And Economics)
  • Analytical Instrumentation
  • Biochemistry
  • Bioinformatics
  • Biology
  • Biotechnology
  • Bitsat
  • Business Statistics
  • C Programming
  • C++ Programming
  • Cell Biology
  • Chemistry
  • Cost Accounting
  • Drug And Pharmaceutical Biotechnology
  • Electrical Measurement And Instrumentation
  • Environment Management
  • Environmental Biotechnology
  • Enzyme Technology
  • Financial Management And Financial Markets
  • Gate
  • General Science
  • Geography
  • Heat Transfer
  • History And National Movements
  • Human Anatomy And Physiology
  • Human And Cultural Diversity
  • Human Resource Management
  • Indian Economy
  • Indian Geography
  • Indian History
  • Indian Polity
  • Instrumentation Transducers
  • International Relations
  • Life Sciences
  • Marketing And Marketing Management
  • Mass Transfer
  • Mechanics Of Materials
  • Microbiology
  • Neet
  • Professional Communication
  • Renewable Energy
  • Sociology
  • Surveying
  • Total Quality Management
  • Uidai Aadhaar Supervisor Certification
  • Virology

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.   ....

LakshyaEducation.in
Lakshya Education
Bhilai,Chattisgarh,India
Email: admin@lakshyaeducation.in Phone: 07893519977 (WhatsApp)

Quick Links

  • Vedic Maths
  • Quantitative Aptitude
  • Class – IX Maths
  • Class – X Maths
  • YouTube Channel
  • Maths Fast Trick
  • Blog

Our Services

  • About us
  • Privacy
  • TOS
  • Refund / Cancellation
  • Contact
  • Affiliate Program
  • Copyright © 2022 All Right Reserved | Lakshya Education     ( )
    Login / Register

    Your Account will be created automatically when you click the below Google or Facebook Login Button.
    •   Login With Facebook
    •  Login With Google
     Login With Email/Password