Saturday, July 4, 2020

Oops with C++


c++
1-1. C++ was originally developed by
A.  
Nicolas Wirth
B.  Donald Knuth
C.  Bjarne Stroustrup            `
D.  Ken
 Thompson
1-2. The standard C++ comment
A.  /
B.  //
 
C.  /* and */
D.  None of these
1-3. The preprocessor directive #include is required if
A.  Console output is used
B.  Console input is used
C.  Both console input and output is used
D.  None of these
1-4. The operator << is called
A.  an insertion operator
B.  put to operator
C.  either a or b
D.  None of these
1-5. The operator >> is called
A.  an extraction operator
B.  a get from operator
C.  either a or b
D.  get to operator
1-6. The C++ symbol <<
A.  perform the action of sending the value of expression listed as its right to the
outputs strewn as the left.
B.  is used to indicate the
 action from right to left
C.  is adopted to resemble an arrow
D.  All of above
1-7. When a language has the capability to produce new data type, it is called
A.  Extensible
B.  Overloaded
C.  Encapsulated
D.  Reprehensible
1-8. C++ name was suggested by
A.  Rrick Mascitti
B.  Bjarne Stroustrup
C.  Donald Knuth
D.  Ken
 Thompson
1-9. What is a reference?
A.  an operator
B.  a reference is an alias for an object
C.  used to rename an object
D.  None of these
1-10. State the object oriented languages
A.  C++
B.  Java
C.  Eiffel
D.  All of the above




Answers
1 – C / 2 – B / 3 – C / 4 – C / 5 – C / 6 – D / 7 – A / 8 – A / 9 – B / 10 – D
______________________________________________________________


 

-1. A constructor is called whenever
A.  a object is
 declared
B.  an object is used
C.  a
 class is declared
D.  a
 class is used
2-2. Overload function in C++
A.  
a group function with the same name
B.  all have the same
 number and type of arguments
C.  functions with same name and same
 number and type of arguments
D.  All of the above
2-3. Operator overloading is 
A.  making C++ operators works with objects
B.  giving new meaning to existing C++ operators
C.  making new C++ operator
D.  both a & b above
2-4. A constructor is called whenever
A.  a object is
 declared
B.  an object is used
C.  a
 class is declared
D.  a
 class is used
2-5. A class having no name
A.  is not allowed
B.  can’t have a constructor
C.  can’t have a destructor
D.  can’t be passed as an argument
2-6. The differences between constructors and destructor are
A.  constructors
 can take arguments but destructor can’t
B.  constructors
 can be overloaded but destructors can’t be overloaded
C.  both a & b
D.  None of these
2-7. A destructor takes
A.  one argument
B.  two
 arguments
C.  three arguments
D.  Zero
 arguments
2-8. Constructors are used to
A.  initialize the objects
B.  construct the data members
C.  both a & b
D.  None of These
2-9. In C++ a function contained within a class is called
A.  a member function
B.  an operator
C.  a
 class function
D.  a method
2-10. The fields in a class of a C++ program are by default
A.  protected
B.  public
C.  private
D.  None of these


Answers
1 – A / 2 – A / 3 – D / 4 – A / 5 – C / 6 – C / 7 – D / 8 – A / 9 – A / 10 – C





1. Que. Which of the following type of class allows only one object of it to be created?
A. Virtual class
B. Abstract class
C. Singleton class
D. Friend class
Answer: Option C 

Que.  Which one is not a correct variable type in C++?

Show Answer  B

Que. Which operation is used as Logical 'AND'



Answer : Operator-&& [Option : C]
Que. An expression A.B in C++ means ____
A. A is member of object B
B. B is member of Object A
C. Product of A and B
D. None of these

Answer : B is member of Object A [Option : B]

 
Que. C++ code line ends with ___

A Semicolon (;)
B. A Fullstop(.)
C. A Comma (,)
D.A Slash (/)

Answer : A Semicolon (;) [Option : A]
.    
______ function is used to allocate space for array in memory.
A. malloc()
B. realloc()
C. alloc()
D. calloc()

Answer : calloc() [Option : D]


.    
Que A ponter pointing to a variable that is not initialized is called ____
A. Void Pointer
B. Null Pointer
 C. Empty Pointer
D. Wild Pointer

Answer : Null Pointer [Option : B]


    
QueDefault constructor has ____ arguments.
A. No argument
B. One Argument

C. Two Argument
D. None of these

Answer : No argument [Option : A]

Que .A class whos objects can not be created is known as _____
A. Absurd Class
B. Dead Class
C. Super Class
D. Abstract Class

Answer : Abstract Class [Option : D]

Q.  Which class allows only one object to be created.
A. Nuclear Family Class
B. Abstruct Class
C. Sigleton Class
D. Numero Uno Class

Answer : Sigleton Class [Option : C] 
Q. Reusability of code in C++ is achieved through ____
A. Polymorphism
B. Inheritance
C. Encapsulation
D.Both A and B

Answer : Inheritance [Option : B]

Q. In CPP, members of a class are ______ by default.
A. Public
B. Private
C. Protected
D. Static
Answer : Private [Option : B]
Q.  In C++ Program, inline fuctions are expanded during ____
A. Run Time
B. Compile Time
C. Debug Time
D. Coding Time

Answer : Run Time [Option : A]

Q.  To perfor file input / output operation in C++, we must include which header file ?
A. <fiostream>
B. <ifstream>
C. <ofstream>
D. <fstream>

Answer : <fstream> [Option : D]

Q.  An exceptio in C++ can be generated using which keywords.
A. thrown
B. threw
 C. throw
D. throws

Answer : throw [Option : C]




Data TypeSize (in bytes) Range
short int 2 -32,768 to 32,767
unsigned short int 2 0 to 65,535
unsigned int 4 0 to 4,294,967,295
int 4 -2,147,483,648 to 2,147,483,647
long int 4 -2,147,483,648 to 2,147,483,647
unsigned long int 4 0 to 4,294,967,295
long long int 8 -(2^63) to (2^63)-1
unsigned long long int 8 0 to 18,446,744,073,709,551,615
signed char 1 -128 to 127
unsigned char 1 0 to 255
float 4
double 8
long double 12
wchar_t 2 or 4 1 wide character




No comments:

Post a Comment

Tally

  अकाउंटिंग आधुनिक व्यवसाय का आकार इतना विस्तृत हो गया है कि इसमें सैकड़ों , सहस्त्रों व अरबों व्यावसायिक लेनदेन होते र...