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
  • Character Types

C++ Programming

CHARACTER TYPES MCQs

Total Questions : 10

Question 1.

What constant defined in <climits> header returns the number of bits in a char?


  1.    CHAR_SIZE
  2.    SIZE_CHAR
  3.    BIT_CHAR
  4.    CHAR_BIT
 Discuss Question
Answer is Option D. -> CHAR_BIT

None.

Question 2.

Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?


  1.    4
  2.    1
  3.    Implementation dependent
  4.    Machine dependent
 Discuss Question
Answer is Option B. -> 1

The standard does NOT require a char to be 8-bits, but does require that sizeof(char) return 1.

Question 3.

Is the size of character literals different in C and C++?


  1.    Implementation defined
  2.    Can't say
  3.    Yes, they are different
  4.    No, they are not different
 Discuss Question
Answer is Option C. -> Yes, they are different

In C++, sizeof('a') == sizeof(char) == 1. In C however, sizeof('a') == sizeof(int).

Question 4.

In C++, what is the sign of character data type by default?


  1.    Signed
  2.    Unsigned
  3.    Implementation dependent
  4.    None of these
 Discuss Question
Answer is Option C. -> Implementation dependent

The standard does not specify if plain char is signed or unsigned. There are three distinct character 

types according to the standard: char, signed char and unsigned char.

Question 5.


What is the output of this program?



1.
#include
2.
int main()
3.
{
4.
char a = '\012';
5.

6.
printf("%d", a);

7.
return 0;
8.
}


  1.    Compiler error
  2.    12
  3.    10
  4.    Empty
 Discuss Question
Answer is Option C. -> 10

The value '`setminus`012' means the character with value 12 in octal, which is decimal 10.

Question 6.

Which of the following belongs to the set of character types?


  1.    char
  2.    wchar_t
  3.    only a
  4.    both a and b
 Discuss Question
Answer is Option D. -> both a and b

wchar_t and char is used to represent wide character and character.

Question 7.

How do we represent a wide character of the form wchar_t?


  1.    L'a'
  2.    l'a'
  3.    L[a]
  4.    la
 Discuss Question
Answer is Option A. -> L'a'

A wide character is always indicated by immediately preceding the character literal by an L.

Question 8.


What will be the output of this program?

1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
char c = 74;
6.
cout

  1.    A
  2.    N
  3.    J
  4.    I
 Discuss Question
Answer is Option C. -> J

The literal value for 74 is J. So it will be printing J.

Question 9.

Select the right option.
Given the variables p, q are of char type and r, s, t are of int type
1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);


  1.    1 is true but 2 is false
  2.    1 is false and 2 is true
  3.    both 1 and 2 are true
  4.    both 1 and 2 are false
 Discuss Question
Answer is Option C. -> both 1 and 2 are true

Every character constant has an integer value. Also char belongs to the integral type hence arithmetic 

and logical operations can be performed on them.

Question 10.

How many characters are specified in the ASCII scheme?


  1.    64
  2.    128
  3.    256
  4.    none of the mentioned
 Discuss Question
Answer is Option B. -> 128

None.

  • 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