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
  • User Defined Types

C++ Programming

USER DEFINED TYPES MCQs

Total Questions : 10

Question 1.

How many types of models are available to create the user-defined data type?


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

There are two types of models. They are references to built-in types and multipart types.

Question 2.

What is the scope of typedef defined data types?


  1.    inside that block only
  2.    whole program
  3.    outside the program
  4.    none of the mentioned
 Discuss Question
Answer is Option B. -> whole program

We are defining the user-defined data type to be availed only inside that program, if we want 

to use anywhere means we have to define those types in the header file.

Question 3.

How many types of user-defined data type are in c++?


  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer is Option C. -> 3

There are three types of user-defined data types. They are typedef, union, enumerator.

Question 4.

What is the syntax of user-defined data types?


  1.    typedef_existing data type_new name
  2.    typedef_new name_existing data type
  3.    def_existing data type_new name
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> typedef_existing data type_new name

None.

Question 5.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
typedef int num;
6.
typedef char let;
7.
let w = "steve";
8.
num a = 10, b = 15;
9.
num c = a + w;
10.
cout
  1.    10steve
  2.    steve10
  3.    compile time error
  4.    compile but not run
 Discuss Question
Answer is Option C. -> compile time error

error: invalid conversion from 'const char*' to 'let {aka char}'

Question 6.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int i;
6.
enum month {
7.
JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,DEC
8.
};
9.
for (i = JAN; i
  1.    012345678910
  2.    0123456789
  3.    01234567891011
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> 012345678910

In this program, we are defined the data types as enumerator and printing its value in a order.
Output:
$ g++ user1.cpp
$ a.out
012345678910

Question 7.


What is the output of this program?



1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
typedef int num;
6.
num a = 10, b = 15;
7.
num c = a + b + a - b;
8.
cout
  1.    20
  2.    15
  3.    30
  4.    25
 Discuss Question
Answer is Option A. -> 20

In this program, we are manipulating the numbers and printing the result using user-defined 

data types.
Output:
$ g++ user.cpp
$ a.out
20

Question 8.

What does the data type defined by union will do?


  1.    It allow one different portion of memory to be accessed as same data types
  2.    It allow one same portion of memory to be accessed as same data types
  3.    It allow one different portion of memory to be accessed as different data types
  4.    It allow one same portion of memory to be accessed as different data types
 Discuss Question
Answer is Option D. -> It allow one same portion of memory to be accessed as different data types

Union is used to define the data types of our choice and it will store the data type in one 

location make them accessible.

Question 9.

Identify the correct statement.


  1.    typedef does not create different types.It only creates synonyms of existing types.
  2.    typedef create different types.
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer is Option A. -> typedef does not create different types.It only creates synonyms of existing types.

By using typedef, we can create a type of pre-existing type only not our own type of data.

Question 10.

Which keyword is used to define the user defined data types?


  1.    def
  2.    union
  3.    typedef
  4.    type
 Discuss Question
Answer is Option C. -> typedef

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

Recent Posts

  • Sail E0 Results 2022
  • Quantitative Aptitude Faqs
  • Vedic Maths Faq
  • Sail E0 Exam Results Cancelled - Exam Will Be Rescheduled
  • Is Ssc Difficult Than Upsc?
  • Ssc Exam Guide Book
  • Best Ssc Exam For Girls

Recent Questions

Q.   According To The Affordable Care Act, Children Can Be On The....

Q.   A Truncated Polypeptide Is Synthesized Due To A Nonsense Mut....

Q.   How Do The British Economists And Political Scientists React....

Q.   Which Of The Following Is Not A Product Of Anaerobic Digesti....

Q.   The Ratio For The Rate Of Washing To The Final Rate Of Filtr....

Q.   To Turn On UJT, The Forward Bias On The Emitter Diode Should....

Q.   Which Of The Following IR Radiation Is Used In Measuring Rel....

Q.   The Hottest Part Of The Gas Flame Is Known As

Q.   Ethyl Alcohol Cannot Be Produced

Q.   Which Of The Following Can Be Correct Conclusion Drawn From ....

Q.   ISS Is Less Sensitive Than Which Of The Following?

Q.   Which Of The Following Is The Most Effective Inhibitor Of Gr....

Q.   A Metallic Alloy In Which One Of The Constituent Metal Is __....

Q.   Defense Department Analysts Worry That The Ability Of The Un....

Q.   S1: If You Want To Do Well In Your Examinations You Need To ....

Q.   Which One Of The Following Is Also Known As Solution ?

Q.   (0.1667)(0.8333)(0.3333) Is Approximately Equal To: ....

Q.   IR Is The Study Of

Q.    if The Radius Of A Sphere Is Increased By 2 Cm, Then Its S....

Q.   Statement I: When Water Is Heated, We See bubbles In It....

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