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
  • Constants

C++ Programming

CONSTANTS MCQs

Total Questions : 9

Question 1.

How to declare a wide character in string literal?


  1.    L prefix
  2.    l prefix
  3.    W prefix
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> L prefix

It can turn this as wide character instead of narrow characters.

Question 2.

The difference between x and 'x' is


  1.    The first one refers to a variable whose identifier is x and the second one refers to the character constant x
  2.    The first one is a character constant x and second one is the string literal x
  3.    Both are same
  4.    None of the mentioned
 Discuss Question
Answer is Option A. -> The first one refers to a variable whose identifier is x and the second one refers to the character constant x

None.

Question 3.

Regarding following statement which of the statements is true?
 const int a = 100;


  1.    Declares a variable a with 100 as its initial value
  2.    Declares a construction a with 100 as its initial value
  3.    Declares a constant a whose value will be 100
  4.    Constructs an integer type variable with a as identifier and 100 as value
 Discuss Question
Answer is Option C. -> Declares a constant a whose value will be 100

Because the const is used to declare non-changable values only.

Question 4.

Which of the following statement is not true about preprocessor directives?


  1.    These are lines read and processed by the preprocessor
  2.    They do not produce any code by themselves
  3.    These must be written on their own line
  4.    They end with a semicolon
 Discuss Question
Answer is Option D. -> They end with a semicolon

None.

Question 5.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
#define PI 3.14159
4.
int main ()
5.
{
6.
float r = 2;
7.
float circle;
8.
circle = 2 * PI * r;
9.
cout
  1.    12.5664
  2.    13.5664
  3.    10
  4.    compile time error
 Discuss Question
Answer is Option A. -> 12.5664

In this program, we are finding the area of the circle by using concern formula.
Output:
$ g++ cons.cpp
$ a.out
12.5664

Question 6.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int const p = 5;
6.
cout
  1.    5
  2.    6
  3.    Error
  4.    None of the mentioned
 Discuss Question
Answer is Option C. -> Error

We cannot modify a constant integer value.

Question 7.

The constants are also called as


  1.    const
  2.    preprocessor
  3.    literals
  4.    none of the mentioned
 Discuss Question
Answer is Option C. -> literals

None.

Question 8.

What are the parts of the literal constants?


  1.    integer numerals
  2.    floating-point numerals
  3.    strings and boolean values
  4.    all of the mentioned
 Discuss Question
Answer is Option D. -> all of the mentioned

Because these are the types used to declare variables and so these can be declared as constants.

Question 9.

How the constants are declared?


  1.    const keyword
  2.    #define preprocessor
  3.    both a and b
  4.    None of the mentioned
 Discuss Question
Answer is Option C. -> both a and b

The const will declare with a specific type values and #define is used to declare user definied 

constants.

  • 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.   DIVA:OPERA

Q.   All Computers Must Have __________

Q.   Which Of The Following Statements Are Correct With Regard To....

Q.   (solve As Per The Direction Given Above)

Q.   Deficiency Of 'Thiamine' Causes

Q.   In Each Question Below A Sentence Broken Into Four Or Five P....

Q.   IRS 1A And 1B Satellites Can Carry Which Of The Following Se....

Q.   ....

Q.   For A Dc Machine Shunt Resistance And Armature Resistance Va....

Q.   ....

Q.   Who Among The Following Was The First English Man To Visit W....

Q.   Find The Correctly Spelt Word

Q.   The Color Of Fluorine Is

Q.   Rashi Went  toy Shopping With Her Mother And Saw A Toy ....

Q.   The Process Partially Responsible For The Life On Earth Is

Q.   What Is The Place Of The Indian Men's Cricket Team In The La....

Q.   ....

Q.   Match The Following: 1. Nishka (i) Later Vedic Coi....

Q.   Which Fertiliser Is Made (using Coke Oven Gas) In By Product....

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