CBSE - MCQ Question Banks (के. मा. शि. बो . -प्रश्नमाला )

PreviousNext

Q. 192501 The result of the expression 22%5 is


A. 0.

B. 1.

C. 2.

D. 4.

Right Answer is: C

SOLUTION

The modulus operator returns the remainder, when 22 is divided by 5, which is 2.


Q. 192502 C++ is case sensitive. This statement


A. is false.

B. depends on implementation.

C. depends on operating system.

D. is true.

Right Answer is: D

SOLUTION

C++ is case sensitive, as the code is written in C++ turbo compiler. The syntax makes the language case sensitive.


Q. 192503 The data type in C++, that is the equivalent of Pascal's Real is


A. unsigned int.

B. float .

C. char.

D. signed int.

Right Answer is: B

SOLUTION

The data type float represents a class of objects that are real numbers, or numbers having decimal. For example -4.56.


Q. 192504
Right Answer is: D

SOLUTION

In the above expression, first && operators executes, followed by ||. Thus, the result 1 is obtained which corresponds to true.


Q. 192505 C++ was developed by


A. Bjarne Stroustrop.

B. Dennis Ritchie.

C. James Gosling.

D. Bill Gates.

Right Answer is: A

SOLUTION

C++ was developed by Bjarne Stroustrop. It is Originally designed for system programming, it enables programmers to write efficient code and provided close access to the machine.


Q. 192506 C++ was introduced in the year


A. 1981.

B. 1983.

C. 1980.

D. 1985.

Right Answer is: D

SOLUTION

In 1980, Bjarne Stroustrup, from Bell labs, began the development of the C++ language, which received formally this name at the end of 1983, when its first manual was published. In October 1985, the first release of the language appeared.


Q. 192507 Among the following, whitespace character is


A. @.

B. /n.

C. !.

D. _.

Right Answer is: B

SOLUTION

Blank space, horizontal tab, carriage return, newline, form feed all come under whitespace, used in a C++ program.


Q. 192508 Lexical units is another name for


A. tokens.

B. keywords.

C. identifiers.

D. literals.

Right Answer is: A

SOLUTION

Lexical units are the tokens that are combined together to form the translation unit.


Q. 192509 In C++, a valid keyword is


A. num.

B. real.

C. dowhile.

D. switch.

Right Answer is: D

SOLUTION

switch is a valid keyword in C++, and is used in place of many if statements.


Q. 192510 In C++, a valid variable name is


A. 1class.

B. _student.

C. 23y7

D. 89ER

Right Answer is: B

SOLUTION

Variable names in C++ cannot start with a number.


Q. 192511 The keyword, used to declare an enumeration in C++ is


A. enum.

B. enumerate.

C. enums.

D. enumeration.

Right Answer is: A

SOLUTION

Enumeration is used in an ordered list context, which is declared using the keyword enum in C++.


Q. 192512 The character /? is used to denote a


A. question mark.

B. conditional operator.

C. literal question mark.

D. literal conditional operator.

Right Answer is: C

SOLUTION

A ? denotes a question mark but when / is used along with it, its meaning changes and it becomes a character constant , that is a literal.


Q. 192513 A union is a


A. structure.

B. name of the function.

C. class.

D. memory location.

Right Answer is: D

SOLUTION

A union is a memory location that is shared by two or more different variables, generally of different types at different times. The keyword union is used for declaring and creating a union.


Q. 192514 When grammatical rule in C++ is violated, then it is


A. logical error.

B. type error.

C. syntax error.

D. semantic error.

Right Answer is: C

SOLUTION

Syntax error occurs when rules of a programming language are misused. Syntax refers to formal rules governing the construction of valid statements in a language.


Q. 192515 The statement to output The sum of 3+2=5 is


A. cout>> "the sum of 3+2 =5;

B. cout<< "the sum of 3+2 = " <<3+2;

C. cin<<3+2=5;

D. cin<< "3+2=5";

Right Answer is: B

SOLUTION

cout<< "the sum of 3+2 = " <<3+2; is correct way for output.


Q. 192516 Bitwise operators are


A. + ,* and -.

B. << and >>.

C. II and &&.

D. & , ^,I.

Right Answer is: D

SOLUTION

Bitwise operators return bitwise combinations of their operands. The bitwise operators are: Bitwise AND (&) Bitwise exclusive OR (^) Bitwise inclusive OR (|)


Q. 192517 # is called in C++


A. ellipsis.

B. asterisk.

C. brace.

D. pound sign.

Right Answer is: D

SOLUTION

The pound sign( # ) is used for preprocessor directive.


Q. 192518 String literal is


A. treated as an array of char.

B. treated like an structure.

C. is not automatically added with ''.

D. can be written in OXC form.

Right Answer is: A

SOLUTION

String literal is treated as array of char which has special character'0' which makes the end of string.


Q. 192519 Multi character constants are


A. String literals in single quotes.

B. Literal constants.

C. are not added with double quotes" ".

D. treated as integers.

Right Answer is: D

SOLUTION

Multicharacter constants are integer type and they are implementation dependent.


Q. 192520 Floating constants are


A. integer constants.

B. real constants.

C. char constants.

D. string constants.

Right Answer is: B

SOLUTION

A floating point constant are also called real constant, as it is used to represent decimal values as well as fractional form.


Q. 192521 Which is the invalid form of real constant


A. -0.006.25

B. 35.66

C. + 5.0

D. 15,356.30

Right Answer is: D

SOLUTION

A real constant does not allow comma in between digits.


Q. 192522 Real constants must have


A. mantissa and exponent in exponent form.

B. decimal point.

C. one digit after decimal point.

D. underscore.

Right Answer is: C

SOLUTION

A real constant in fractional form must have at least one digit before a decimal point and at least one digit after the decimal point.


Q. 192523 Multiple character have data type


A. int.

B. char.

C. float.

D. void.

Right Answer is: A

SOLUTION

A multi-character constant are treated as integers and their values are implementation dependent.


Q. 192524 'n' is an


A. escape sequence for backspace.

B. escape sequence for end.

C. escape sequence for null.

D. escape sequence for newline.

Right Answer is: D

SOLUTION

An escape sequence for newline is represented by backslash followed by'n'.


Q. 192525 0XC is an


A. Integer.

B. Character constant.

C. Hexadecimal integer constant.

D. String Literal.

Right Answer is: C

SOLUTION

A sequence of digits preceded by 0x or 0X is taken to be an hexadecimal integer thus 0XC is a Hexadecimal integer constant.


Q. 192526 33125.35+65 is


A. Hexadecimal constant.

B. octal integer constant.

C. decimal integer constant.

D. multi-character constant.

Right Answer is: C

SOLUTION

An integer constant consisting of a sequence of digits is taken as decimal integer constants.


Q. 192527 Characters are


A. implement dependent.

B. not implement dependent.

C. array independent.

D. literals.

Right Answer is: A

SOLUTION

Character constant is implementation dependent. Example:Multi-character constants have int data type.


Q. 192528 Names given to variables, objects, classes, functions, arrays etc are called


A. variables.

B. constants.

C. Identifier names.

D. keywords.

Right Answer is: C

SOLUTION

Identifiers are fundamental building blocks of a program and used as naming different parts of the program.


Q. 192529 asm is a


A. Keyword.

B. Identifier.

C. Literal.

D. Operator.

Right Answer is: A

SOLUTION

The asm keyword invokes the inline assembler. It must be followed by an assembly instruction, a group of instructions enclosed in braces.


Q. 192530 Literals are referred to as


A. keywords.

B. constants.

C. variables.

D. operators.

Right Answer is: B

SOLUTION

Literals are often referred as constants as their value never change during runtime.


Q. 192531 An identifier is a sequence of characters used to denote


A. array.

B. pointer.

C. reference.

D. object.

Right Answer is: D

SOLUTION

An identifier is a sequence of characters used to denote object or variable name.


Q. 192532 User defined data types are


A. class.

B. structure.

C. union and enumeration

D. all of the above

Right Answer is: D

SOLUTION

User defined data types are derived from fundamental data types(int, char, float, double, void).


Q. 192533 Types of literals allowed in C++ are


A. 2 types.

B. 5 types.

C. 4 types.

D. 10 types.

Right Answer is: C

SOLUTION

Literals means constants, C++ allows four types of literals,i.e., integer, character, floating point and string literals.


Q. 192534 The statement a=++b; would


A. increment the value of b, before assignment.

B. increment the value of b, after assignment.

C. assign b to a and then, increment their sum.

D. calculate the sum of a and b two times.

Right Answer is: A

SOLUTION

++ is a pre-increment operator. Therefore, it would increment the value of b and assign it to a.


Q. 192535 In C++, the output of the statement 7==5 ? 4 : 3 is


A. 3.

B. 4.

C. 5.

D. 7.

Right Answer is: A

SOLUTION

7==5 ? 4 : 3 returns 3, since 7 is not equal to 5.


Q. 192536 In C++, the output of the statement 7==5+2 ? 4 : 3 is


A. 2.

B. 3.

C. 4.

D. 5.

Right Answer is: C

SOLUTION

7==5+2 ? 4 : 3 returns 4, since 7 is equal to 5+2.


Q. 192537 Every function in c++ has its code


A. within square brackets.

B. within angular bracket.

C. within curly braces.

D. no bracket used etc.

Right Answer is: C

SOLUTION

Every function in C++ has its code within curly braces. { }


Q. 192538 The error in this statement cout << computers can be fun ; is ,


A. >> should be used instead of <<.

B. double quotes are not used.

C. there should be a space between < and <.

D. semicolon should not be used.

Right Answer is: B

SOLUTION

Correct sentence is cout << " computers can b fun ";


Q. 192539 The function of endl is


A. same as 'n'.

B. to send a newline character 'n' and then, flush the output buffer.

C. it flushes the output buffer.

D. to send a newline character 'n' but, does not flush the output buffer.

Right Answer is: B

SOLUTION

'n' and endl manipulator sends a new line character 'n' but endl also flushes the output buffer whereas, 'n' does not flush the output buffer.


Q. 192540 Manipulators used in C++ are


A. setw, setiosflags, setfill, setprecision.

B. cout, cin.

C. 'n'.

D. setw, endl and scope resolution operator.

Right Answer is: A

SOLUTION

setw, setiosflags, setfill, setprecision, endl are manipulators. Manipulators are used to change formatting parameters on streams, and to insert or extract certain special characters.


Q. 192541 A class represents


A. a group of different objects.

B. a group of similar objects.

C. a structure.

D. a data type.

Right Answer is: B

SOLUTION

The class represents a group of similar objects. It describes all the properties of a data type, and an object is an entity created according to that description.


Q. 192542 A character constant is


A. enclosed in double quotes .

B. enclosed in single quotes.

C. enclosed in brackets.

D. enclosed in parenthesis.

Right Answer is: B

SOLUTION

Text enclosed in single quotes is treated as character constant. The type of character constant is int. Its value is the ASCII code for the character.


Q. 192543 Unary operator used in C++ requires


A. one operand.

B. two operands.

C. three operands.

D. four operands.

Right Answer is: A

SOLUTION

The word unary means one. Post increment operator is an example of unary operator. It takes one operand as input and processes it to give the output.


Q. 192544 The operand of unary + must have


A. character type.

B. assignment type.

C. arithmetic or pointer type.

D. modulus type.

Right Answer is: C

SOLUTION

The operator unary + must have arithmetic or pointer type; since, it returns values of arithmetic type.


Q. 192545 During a program run, literals are


A. constants.

B. varying float numbers.

C. varying integers.

D. string.

Right Answer is: A

SOLUTION

Literals are data items, which never change their value during a program run. They are integer constant, character-constant, floating constant and string-literal.


Q. 192546 The assignment operator used in C++ program


A. assigns the l value to the r value (left to right rule).

B. assigns the r value to the l value (right to left rule).

C. can be in either way.

D. compare two values.

Right Answer is: B

SOLUTION

The assignment operation always takes place from right to left, and never the other way. Example: a=b; this statement assigns to variable a (the l value) the value contained in variable b (the r value).


Q. 192547 The error in the given code is
 #include < iostream.h >
 void main()
 {
   int sum,9var,sum-3;
   cin>>sum;
   sum=sum+1;
   cout << sum;
  }


A. conio.h is not included.

B. sum should be float.

C. 9var and sum-3 are invalid identifiers.

D. There should be a semicolon after}.

Right Answer is: C

SOLUTION

A variable name can never start with a number. A variable name cannot include any special characters except,  _ and $.


Q. 192548 The error in the given code is
int main()
{
  cout<<“enter variable”;
  cin>>var;
  sqrs1=var*var;
  cout<<“The square is” < < sqrs1;
 }


A. sqrs1 cannot be a variable name.

B. >> should be used in place of <<.

C. variables are  not declared before use.

D. main can not have int as its data type.

Right Answer is: C

SOLUTION

Since, variables are not declared before their use, a syntax error occurs.


Q. 192549 Assume that X has been declared as an integer variable in a C++ program. If the program encounters, non-integer data while reading the value of X then,


A. run time error occurs.

B. type casting occurs.

C. semantic error occurs.

D. type error occurs.

Right Answer is: D

SOLUTION

If non-integer data like a string is entered for integer data type, then type error occurs. It can be rectified by retyping the data in an integer form or by converting the non-integer data into integer form.


Q. 192550 The operator used to separate two or more expressions that are included, where only one expression is expected is


A. .

B. ?.

C. >

D. ,

Right Answer is: D

SOLUTION

When the set of expressions has to be evaluated for a value, only the rightmost expression is considered. These expressions are separated with the help of a comma operator.


Q. 192551 The name given to a label is an example of


A. a keyword.

B. an identifier.

C. a character literal.

D. a literal constant.

Right Answer is: B

SOLUTION

An identifier is a sequence of characters, used to denote a label name.


Q. 192552 In C++, ## is used to


A. perform token replacement.

B. perform preprocessor operations.

C. include two header files at the same time.

D. include a library function.

Right Answer is: A

SOLUTION

# is used for preprocessor directives and ## is used to perform token replacement and merging, during the preprocessor scanning phase.


Q. 192553 The procedure marking the start of execution of a C++ program is


A. exe( ).

B. main( ).

C. void( ).

D. start( ).

Right Answer is: B

SOLUTION

main() indicates the start of any program. A program cannot execute without a main() in C++.


Q. 192554 A class whose properties are inherited by other class is called a


A. class of an organization.

B. subclass.

C. base class

D. derived class.

Right Answer is: C

SOLUTION

The superclass inherits the properties of a subclass or derived class.


Q. 192555 Hiding intricate details from the end user


A. is called inheritance.

B. is an essential principal of system design.

C. is called abstraction.

D. is called ploymorphism.

Right Answer is: C

SOLUTION

Abstraction refers to the act of representing essential features without including the background details or explanation.


Q. 192556 A number of functions can be grouped and kept as a separate entity called


A. module.

B. abstraction.

C. polymorphism.

D. data.

Right Answer is: A

SOLUTION

A module is a separate unit of software or hardware.


Q. 192557 The object oriented programming gives more importance to


A. reuse feasibility.

B. data.

C. user.

D. information.

Right Answer is: A

SOLUTION

Object oriented programming is based on objects and classes.


Q. 192558 Function overloading implements


A. data abstraction.

B. data encapsulation

C. reusability.

D. polymorphism.

Right Answer is: D

SOLUTION

In order to overload a function, a different signature should be used for each overloaded version.


Q. 192559 What does 'paradigm' mean ?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

It refers to a different way of looking at a problem.


Q. 192560 What is a High Level Language? Give some examples.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

High Level Language (HLL) is a technical language close to human understanding in English. Cobol, Fortran, C++ are some examples of HLLs.
 


Q. 192561 What do you understand by 'assembly language'?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Assembly language is a language in which instructions are written using symbolic names for machine operations. For example, READ, ADD, STORE.


Q. 192562 Give the full form of OOP.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

OOP stands for Object Oriented Programming.


Q. 192563 What are the various 'objects' you can find in your drawing room?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

As we enter in our drawing room, we look for different things kept around i.e., a sofa, a chair, carpet, curtains etc. All these are the objects kept there.


Q. 192564 State two advantages of inheritance.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

The advantages are as follows:
i) Can use the same codes used in the base class.
ii) Since the code has already been tested in the base class, you do not have to do many dry runs.


Q. 192565 What is a member function ?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Under enscapsulation, the functions working on the data are referred to as member functions.

 


Q. 192566 State a real life example of 'abstraction'.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

A car driver is concerned with driving. He need not go into the details about wires, engine, brakes etc. It is termed as abstraction.

 


Q. 192567 What is Abstraction ?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Abstraction refers to the act of representing essential features without including the background details or explanation. It refers to the concept of simplifying real world concepts into its essential elements.


Q. 192568 Can data arrangement be changed easily in modular programming?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

In modular progmming, many modules share the same data. The arrangement of data can’t be changed without modifying all the modules.


Q. 192569 What is a module?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Module is a property of a system that has been decomposed into a set of cohesive and loosely coupled modules.


Q. 192570 Explain the transitive nature of inheritance.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

The transitive nature of inheritance states that if a class A inherits properties from its base class B then all its subclasses will also be inheriting the properties of base class of A i.e., B.


Q. 192571 What do you understand by procedural progamming paradigm?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

The programming approach that focuses on the procedures for the solution of a problem is known as procedural programming paradigm. This approach emphasizes on the 'doing' rather than the 'data'.    


Q. 192572 What are low-level languages?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Low level languages (machine language and assembly language) are machine-oriented and require extensive knowledge of machine circuitry. In machine language, the instructions are given in binary codes whereas in assembly language, instructions are given in symbolic names (mnemonics).


Q. 192573 What is the difference between a class and an object in C++?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

A class is defined as a group of objects that share common properties and relationships. A class is a group of objects. Object is an identifiable entity with some characteristics and behaviour.


Q. 192574 Give one real life example of a 'class' and  its 'objects'.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Dog is a class. This class consists of many dogs. Let us name them as dog x, dog y and dog z. Here, dog x, dog y and dog z are the objects of class Dog.


Q. 192575 What does you understand by polymorphism?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Polymorphism is a combination of two words viz. poly(=many) and morphs(=forms). Thus, polymorphism means many forms. OOPs shows the features of polymorphism in the form of function overloading. It is the feature of OOP that enables a user to deal with more than one object considering them as the same type.


Q. 192576 How is modular programming approach different from procedural programming paradigm?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

In modular programming, a set of related procedures with the data they manipulate is combined under a unit called module. Where there is no grouping of procedures with related data, the procedural programming approach still applies.


Q. 192577 Distinguish between derived class and base class. How are these two interrelated?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

A derived class is a class that inherits properties from some other class. A base class is a class whose properties are inherited by derived class. A derived class has nearly all properties of base class but the reverse of it is not true.


Q. 192578 What is the advantage of transitive nature of inheritance?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Suppose a class A inherits from class B. Class C and D inherit from A. If there is a bug in B then correction is required only in B as it will be automatically reflected to all subclasses A, C and D if class B has been inherited without changes.


Q. 192579 Why is 'inheritance' important?
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Inheritance creates new objects by expanding existing ones. It is important for the following reasons:
1. It ensures closeness with the real world. It allows reusability. 
2.
It allows addition of additional features to an existing class without modifying it.


Q. 192580 Justify : abstraction and encapsulation are complemetary concepts.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Abstraction focuses upon the observable behaviour of an object, whereas encapsulation focuses upon the implementation that gives rise to this behaviour. Encapsulation is often achieved through information hiding, which is the process of hiding all the secrets of an object that do not contribute to its essential characteristics, the structure of an object is hidden, as well as the implementation of its methods. Only the essential characteristics of object are visible.


Q. 192581 What do you understand by 'modularity'? Explain with the help of a real world example.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules. In other words, the act of partitioning a program into individual components is called modularity.

For example, a music band. It comprises of a piano, guitar etc. These are complete units in themselves, yet they are a subpart of the music band.


Q. 192582 What is 'paradigm'? Give examples.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Paradigm is the organising principle of a program. It is an approach to programming so as to reduce complexities of programming in the rapidly changing world. Procedural progamming, object oriented programming and structural programming are all examples of paradigm.


Q. 192583 State 5 concepts of OOPs.
A. data abstraction.
B. data encapsulation
C. reusability.
D. polymorphism.

Right Answer is:

SOLUTION

Following are the concepts of OOPs:
i) Data Abstraction: It is a concept in which one focuses on some specific things rather than going into the details of other associated things.
ii) Data Encapsulation: It is also known as data hiding. It is the features or a concept of OOP that enables to keep the implemented details of a class hidden from the user.
iii) Inheritance: It is another important concept of OOP in which a new class is formed using already defined classes. The new class is termed, as derived class while the classes whose features are inherited is known as base class.
iv) Polymorphism: Polymorphism is a combination of two words viz. poly(=many) and morphs(=forms). Thus, polymorphism means many forms. OOPs shows the features of polymorphism in the form of function overloading. It is the feature of OOP that enables a user to deal with more than one object considering them as the same type.
v) Modularity: It means dividing the program into sub modules. It is a feature of OOP. It enables a user to reuse the program with ease.


Q. 192584 Explicit type conversion is


A. defined by the user.

B. performed by the compiler.

C. is an automatic conversion.

D. a conversion without programmer intervention.

Right Answer is: A

SOLUTION

An explicit conversion is user-defined that forces an expression to be of a specific type.


Q. 192585 Implicit conversion is performed by


A. user intervention.

B. programmer.

C. operating system.

D. compiler.

Right Answer is: D

SOLUTION

An implicit conversion is applied whenever different data types are intermixed in an expression, so as not to lose information.


Q. 192586 Any variable in C++ is initialized using


A. uninitialized variable.

B. assignment statement.

C. relational operator.

D. typedef.

Right Answer is: B

SOLUTION

In dynamic initialization, assignment is a part of declaration; otherwise an uninitialized variable is declared and initialized in separate statements.


Q. 192587 <, >, <=, >= are examples of


A. increment, decrement operators.

B. arithmetic operators.

C. relational operators.

D. conditional operators.

Right Answer is: C

SOLUTION

Relational refers to the relationships that values (or operands) can have with one another. Thus, the relational operators determine the relation among different operands.


Q. 192588 The operand of unary + must have


A. character type.

B. assignment type.

C. arithmetic or pointer type.

D. modulus type.

Right Answer is: C

SOLUTION

The operator unary + must have arithmetic or pointer type, since it returns values of arithmetic type.


Q. 192589 Unary operator used in C++ requires


A. one operand.

B. two operands.

C. three operands.

D. four operands.

Right Answer is: A

SOLUTION

The word unary means one. Post increment operator is an example of unary operator. It takes one operand as input and processes it to give the output.


Q. 192590 Any variable in C++ is initialized using


A. an uninitialized variable.

B. an assignment statement.

C. a relational operator.

D. a typedef.

Right Answer is: B

SOLUTION

In dynamic initialization, assignment is a part of declaration; otherwise an uninitialized variable is declared and initialized in separate statements using assignment operator.


Q. 192591 Explicit type conversion is


A. defined by the user.

B. performed by the compiler.

C. is an automatic conversion.

D. a conversion without programmer intervention.

Right Answer is: A

SOLUTION

An explicit conversion is user-defined that forces an expression to be of a specific type.


Q. 192592 Implicit conversion is performed by


A. user intervention.

B. a programmer.

C. an operating system.

D. a compiler.

Right Answer is: D

SOLUTION

An implicit conversion is applied whenever different data types are intermixed in an expression, so as not to lose information. This conversion is performed by compiler.


Q. 192593 <, >, <=, >= are examples of


A. increment, decrement operators.

B. arithmetic operators.

C. relational operators.

D. conditional operators.

Right Answer is: C

SOLUTION

Relational operators refers to the relationships that values (or operands) can have with one another. Thus, the relational operators determine the relation among different operands.


Q. 192594 Output operator "<<" is also known as


A. "get from " operator.

B. variable.

C. stream extraction operator.

D. "put to" operator.

Right Answer is: D

SOLUTION

The output operator"<<" is also called "put to" or stream insertion operator.


Q. 192595 At the lowest level files are treated as a stream of


A. arrays.

B. bytes.

C. octal numbers.

D. hexadecimal numbers.

Right Answer is: B

SOLUTION

At the lowest implementation level files are treated as streams of bytes. I/O library manages transfer of these bytes.


Q. 192596 In the statement  h stand for


A. class.

B. stream.

C. header file.

D. Function.

Right Answer is: C

SOLUTION

C++ use header files denoted with extention (.h). These files allow programmers to separate certain elements of a program's source code into reusable files.


Q. 192597 # are directives for the


A. compiler.

B. preprocessor.

C. interpreter.

D. classes.

Right Answer is: B

SOLUTION

Statements that begin with # are processed before compilation takes place.


Q. 192598 The operators in parenthesis are performed


A. last.

B. first.

C. after multiplication and division.

D. before addition and subtraction.

Right Answer is: B

SOLUTION

The operators in parenthesis are performed first because there precedence is higher.


Q. 192599 Unary  operator require


A. two operands.

B. no operand.

C. one operand.

D. none of the above.

Right Answer is: C

SOLUTION

Unary means one. These operators require one operand to operate.


Q. 192600 Character constant is


A. enclosed in double quotes.

B. enclosed in single quotes.

C. enclosed in brackets.

D. none of the above.

Right Answer is: B

SOLUTION

A character constant must contain one character and must be enclosed in single quotation marks.


PreviousNext