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

PreviousNext

Q. 192601 Real numbers can be written in


A. decimal form.

B. only in exponential form.

C. fractional or exponential form.

D. a string literals.

Right Answer is: C

SOLUTION

Real numbers contains fractional parts. These can be written in fractional form or exponent form.


Q. 192602 The base of Octal  number system is –


A. 10

B. 2

C. 16

D. 8

Right Answer is: D

SOLUTION

The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7.


Q. 192603 All statements in C++  terminate with


A. double quotation marks.

B. semicolon.

C. colon.

D. full stop.

Right Answer is: B

SOLUTION

The semicolon( ; ) is part of the syntax of C++. It tells the compiler that you're at the end of a command. Thus used for termination of statements.


Q. 192604 main ( ) is


A. sub class.

B. object.

C. a function name.

D. lastly executed.

Right Answer is: C

SOLUTION

main( )is executed when a program starts. It is the point where all C++ programs begin their execution.


Q. 192605 Integer constants has


A. commas.

B. octal integers.

C. real constants.

D. fractions.

Right Answer is: B

SOLUTION

Integer constants does not contain character or floating numbers. These are whole numbers without any fractional part.


Q. 192606 A string literal refers to


A. multiple character surrounded by single quotes.

B. multiple characters surrounded by double quotes.

C. strings where as ‘ 0’ is not added.

D. none of the above.

Right Answer is: B

SOLUTION

A string literal is the representation of a string value within the source code of a computer program. A regular string literal consists of zero or more characters enclosed in double quotes, as in " hello ".


Q. 192607 Identifiers can be used to describe


A. functions.

B. special characters.

C. reserved keywords.

D. special symbols.

Right Answer is: A

SOLUTION

Identifier are used to describe variables, classes, functions etc.


Q. 192608 During a program run, Literals are


A. constants.

B. variables.

C. varying float numbers.

D. can change.

Right Answer is: A

SOLUTION

Literals are data items that never change their value during a program.


Q. 192609 Words that convey a special meaning to the compiler are


A. Keywords.

B. Identifiers, Literals.

C. Punctuators, operators.

D. Constants.

Right Answer is: A

SOLUTION

Keywords are reserved words for special purpose.


Q. 192610 Operator that evaluates first.


A. <<.

B. +.

C. ( )

D. &&.

Right Answer is: C

SOLUTION

( ) parenthesis evaluates first because of higher precedence.


Q. 192611 A Smallest unit in a program is called


A. token.

B. functions.

C. subclass.

D. Class

Right Answer is: A

SOLUTION

A token is the smallest element of a C++ program that is meaningful to the compiler.


Q. 192612 Predefined data type is


A. not available in c++

B. available in c++

C. Not a part of C++

D. none of the above

Right Answer is: B

SOLUTION

Predefined data types are the fundamental data types, that are the part of C++.


Q. 192613
A. ||=.
B. ^=.
C. && =.
D. &=.

Right Answer is: B

SOLUTION

The bitwise exclusive OR operator (^) compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.


Q. 192614 Modulus operator (%) is an example of


A. relational operator.

B. unary arithmetic operator.

C. increment operator.

D. binary arithmetic operator.

Right Answer is: D

SOLUTION

It produces the remainder on dividing the first by the second operand, which is an integer. Thus, two arguements are passed as an arguement to this operator.


Q. 192615 The code 60 % 5 will result in


A. 0.

B. 1.

C. 10.

D. 12.

Right Answer is: A

SOLUTION

Modulus operator produces the remainder on dividing the first by the second operand.


Q. 192616 The increment and decrement operators


A. are unary operators.

B. are binary operators.

C. operate on many operators.

D. are ternary operators.

Right Answer is: A

SOLUTION

Increment ++ and decrement operators -- operate upon a single operand. they are known as Unary operators.


Q. 192617 The expression x++ + ++x when x =60 evaluates to


A. 120.

B. 121.

C. 122.

D. 124.

Right Answer is: C

SOLUTION

Pre-increment and post-increment operators increase the value of an operand by 1.


Q. 192618 Multiple use of increment /decrement operators on the same operand


A. produces different results on different systems.

B. produces same results on different systems.

C. produces different results on same system.

D. is not implementation dependent.

Right Answer is: A

SOLUTION

Multiple use of these operators on the same operand is discouraged and is purely an implementation dependent.


Q. 192619 The operator '=' used in C++ is


A. an assignment operator.

B. a relational operator.

C. a comparison operator.

D. a unary operator.

Right Answer is: A

SOLUTION

= is used to assign a value. Example value=10 assigns 10 to value(variable).


Q. 192620 The operator `==‘ used in C++ is


A. an assignment operator.

B. a relational operator.

C. a conditional operator.

D. a unary operator.

Right Answer is: B

SOLUTION

== (equal to) is a comparison operator which is used in testing or comparing value. Example value==10 tests whether value is equal to 10 or not? This expression results in value 1 if the comparison is true, and 0 if it is false.


Q. 192621 The number of logical operators provided by C++ are


A. 1.

B. 2.

C. 3.

D. 4.

Right Answer is: C

SOLUTION

C++ provides three logical operators to combine existing expressions. These are || (logical OR), && (logical AND) and ! (logical NOT).


Q. 192622 The operator that evaluates to true, i.e., 1 if both of its operands evaluate to true is called


A. logical AND (&&) operator.

B. logical NOT (!) operator.

C. logical OR (

Right Answer is: A

SOLUTION

The logical AND operator combines two expressions into one. It returns true only when both its operands are true else it returns false. Example: 6>8 && 4>2 results into 0 (false) because the first expression is false.


Q. 192623
A. false.
B. error.
C. run time error.
D. true.

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. 192624 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. 192625
A. ||.
B. !.
C. &&.
D. ?:.

Right Answer is: C

SOLUTION

&& is having highest precedence among the following operators.


Q. 192626 The list having correct precedence of operators is


A. arithmetic > relational > logical > conditional > comma operator.

B. relational > conditional > comma operator > arithmetic > logical.

C. conditional > arithmetic > logical > comma operator > relational.

D. comma operator > arithmetic > logical > conditional > relational.

Right Answer is: A

SOLUTION

The operators are designed to perform the specific task. Higher precedence operators are evaluated first and then lower precedence ones.


Q. 192627 The process of converting one predefined type into another is called


A. type conversion.

B. typedef.

C. type expression.

D. integral promotion.

Right Answer is: A

SOLUTION

Constants and variables are mixed in an expression, then they are converted to same type. This is called type casting or type conversion.


Q. 192628 The header file that must be included to make use of C++ built-in mathematical functions is


A. conio.h

B. math.h

C. stdio.h

D. mathematical.h

Right Answer is: B

SOLUTION

Header files are included into a program source file by the "#include" preprocessor directive.


Q. 192629 The number of chained assignments that are possible in Turbo C++ version 3.0 are


A. 60.

B. 70.

C. 75.

D. 80.

Right Answer is: B

SOLUTION

All the variables participating in the multiple assignment statement must be declared before.


Q. 192630 The C++ shorthand for the code “ x=x/2 ; “ is


A. x= / 2;

B. x= =/ 2;

C. x/ = 2;

D. 2 /= x ;

Right Answer is: C

SOLUTION

Shorthands simplify the code of a certain type of assignment statement.


Q. 192631 The general form of an assignment statement is a=xyz, where


A. “xyz” is the target variable and “a” can be a constant, variable or expression.

B. “a” is the target variable and “xyz” can be a constant, variable or expression.

C. “a” is the target variable and “xyz” is a constant always.

D. “a” is the target variable and “xyz” is a constant or variable only.

Right Answer is: B

SOLUTION

An assignment statement assigns a value to the variable. For Example - a=10;


Q. 192632 The invalid logical expression is


A. x<= ! y && z.

B. (-y).

C. a+b > && z.

D. (x-y).

Right Answer is: C

SOLUTION

Two operators cannot occur in continuation.


Q. 192633 The logical expression to represent the condition “ x is even” is


A. x % 2 == 0.

B. x / 2 = 0.

C. x % 2 =0.

D. x / 2 == 0.

Right Answer is: A

SOLUTION

Modulus operator finds the remainder when one number is divided by another. A number is even if the remainder obtained on dividing it by 2 is 0.


Q. 192634 The logical expression to represent the condition “exp is an uppercase letter” is


A. exp <= 65 && exp >= 90.

B. exp >= 65

Right Answer is: C

SOLUTION

The ASCII codes for uppercase characters are from 65 to 90.


Q. 192635 The statement to print the size of double type on the machine is


A. size of double.

B. sizeof(double).

C. size of double.

D. size (double).

Right Answer is: B

SOLUTION

sizeof operator returns the size of a variable or data type in bytes. The general format is sizeof(type), where type is a C++ data type.


Q. 192636 The statement to print the size of a long variable is


A. size of answer.

B. size of (answer).

C. size of (long answer).

D. sizeof (answer).

Right Answer is: D

SOLUTION

sizeof operator returns the size of a variable or data type in bytes. The general format is sizeof(var) (where var is a declared variable).


Q. 192637 The order of evaluation among logical operators is


A. NOT, OR, AND.

B. OR, AND, NOT.

C. AND, OR, NOT.

D. NOT, AND, OR.

Right Answer is: D

SOLUTION

NOT (!) operator has higher precedence than AND (&&) operator and OR (||) operator.


Q. 192638 The number of relational operators provided in C++ are


A. 3.

B. 5.

C. 7.

D. 6.

Right Answer is: D

SOLUTION

C++ provides 6 relational operators for comparing numbers and characters, which are <,>,<=,>=,!=,==.


Q. 192639 The result of the code "a+= a++ + ++a ", if initially a = 100, is


A. 202.

B. 302.

C. 303.

D. 304.

Right Answer is: D

SOLUTION

Step wise process is a+ = 100+102, a+ = 202, a = 102 + 202 = 304.


Q. 192640 The expression “ 6.8 % 2.2 “ when evaluated, will give the result


A. as error.

B. 0.

C. 0.2.

D. 3.

Right Answer is: A

SOLUTION

Modulus operator requires two int operands and not the float ones.


Q. 192641 The general form of a conditional operator is


A. expr1? expr2 ? expr3.

B. expr1: expr2 ? expr3.

C. expr1? expr2 ; expr3.

D. expr1? expr2 : expr3.

Right Answer is: D

SOLUTION

It gives the value of expr2 if expr1 evaluates to true otherwise it gives the value of expr3.


Q. 192642 The example of a ternary operator is


A. conditional operator.

B. logical AND operator.

C. logical NOT operator.

D. assignment operator.

Right Answer is: A

SOLUTION

Ternary operators require three operands. Relational and assignment operators are binary operators.


Q. 192643 The number of operands required by a binary operator is


A. one.

B. two.

C. three.

D. four.

Right Answer is: B

SOLUTION

A binary operator requires two operands to operate upon.


Q. 192644 The unary compile time operator that returns the length (in bytes) of the variable is called


A. increment operator.

B. size of operator.

C. relational operator.

D. arithmetic operator.

Right Answer is: B

SOLUTION

It can be used in 2 ways: size of var (where var is a declared variable) and size of type (where type is a C++ data type).


Q. 192645 Relation operators can


A. work with strings and numbers.

B. work with numbers, characters but not with strings.

C. not work with characters and strings.

D. work with numbers, characters and strings.

Right Answer is: B

SOLUTION

C++ provides 6 relational operators for comparing numbers and characters, but they don’t work with strings. If the comparison is true, they result into 1, else to 0 if the comparison is false.


Q. 192646 Arithmetic operators in nature are


A. binary operators.

B. unary operators.

C. modulus operators.

D. logical operators.

Right Answer is: A

SOLUTION

Arithmetic operators are binary in nature as they perform operations on two operands.


Q. 192647 The logical expression to check salary range between 3000-5000 is:


A. salary<5000

B. salary>=3000 && salary<=5000

C. salary >5000

D. salary<=3000 && salary>=5000

Right Answer is: B

SOLUTION

The logical expression to check salary range between 3000-5000 is salary>=3000 && salary<=5000. The AND ( &&) operator is used to result in true only when both conditions will satisfy. 


Q. 192648 A pointer holds


A. An integer value

B. Float value

C. Char value

D. Address of a variable

Right Answer is: D

SOLUTION

A pointer is a variable that has the capability of hold address of another variable. It can't hold values, it only holds addresses.


Q. 192649 Condition to check whether the value of variable "x" is even or not is:


A. x/divisor= = 2

B. x/2= 0

C. x%2= =0

D. x*2=even

 

Right Answer is: C

SOLUTION

The condition to check whether the value of variable "x" is even or not is: x%2= =0. The % is the remainder operator that is used to compare whether the value of variable x is divisible by 2 or not.


Q. 192650 It is a unary compile time operator:


A. int

B. %

C. sizeof()

D. &&

Right Answer is: C

SOLUTION

The compile time operator sizeof() is a unary compile-time operator that returns the length of the variable in bytes. Example-    cout << sizeof(int); The above statement will display output as 2.


Q. 192651 Implicit conversion is performed by:


A. Programmer

B. Compiler

C. By both programmer and compiler

D. User defined conversion

Right Answer is: B

SOLUTION

Implicit conversion is performed by compiler automatically without any intervention of user as per the standard conversion/promotion rule.


Q. 192652 The output of the following expression will be: val =2500; sale=val>1700?300:100; cout << sale;


A. 300

B. 100

C. 250

D. 2500

 

Right Answer is: A

SOLUTION

val =2500; sale=val>1700?300:100; cout << sale; The output of the above expression will be 300 because the test condition of the ternary operator is false.


Q. 192653 What is the database type of the expression ‘z’-5 ?


A. char.

B. float.

C. int.

D. long.

Right Answer is: C

SOLUTION

i) ’z’ is char and char is converted to an int. ii) 5 is int. iii) therefore together the expression is int.


Q. 192654 Name any five binary operators?
A. char.
B. float.
C. int.
D. long.

Right Answer is:

SOLUTION

The binary operators are:

1. Arithmetic Operators

2. Logical Operators

3. Relational Operators

4. Conditional Operator

5. Shift Operators


Q. 192655 Explain the following Punctuators-
Parenthesis,Brackets, Astrisk, Ellpsis, Pound Sign
A. char.
B. float.
C. int.
D. long.

Right Answer is:

SOLUTION

Punctuators are also called Seperators:

  1. Parenthesis ( ) opening and closing, indicate parameters as  (a) Calls and (b) Functions.

  2. Brackets [ ] opening and closing, indicate i) Single and ii) multidimensional array.

  3. Astrisk(*) is used as (a) Multiplication sign (b) As a pointer. Astrisk * is a pointer declaration. It is a variable declaration, it denotes creation of a pointer to a data type.

  4. Ellipses … it is used in a formal argument list of functions prototypes and indicates a variable number of arguments and any of data type.

  5. Pound sign # Can be used single # or double ## . Single # is for (a) the preprocessor directive and (b) Double Pound sign ## is used as an operator to perform token replacements and merging during preprocessor scanning phase.

 


Q. 192656 What is  (a) Character Constant and (b)String Literal ?
A. char.
B. float.
C. int.
D. long.

Right Answer is:

SOLUTION

a) Character constant must have one character that should be enclosed within single quotation marks, Eg ‘y’  , ‘n’  , ‘a’ etc.

b) String Literal is a sequence of characters surrounded by double quotes. It by default terminates with a special character ‘0’ which is a string character.
Eg: “Computer Science” is a string literal and it terminates as “Computer Science0”

 


Q. 192657 Explain Integer constants along with there rule ?
A. char.
B. float.
C. int.
D. long.

Right Answer is:

SOLUTION

Integer constants are whole numbers without any fractional part. They follow the  following rules—

i) There must be atleast one digit 

ii) Must not contain any decimal point.

iii) It may contain either a + or a – sign.

iv) A number with no sign is assumed to be positive.

v) No commas or blanks are allowed within an integer constant. 


Q. 192658 List the tokens in C++ .
A. char.
B. float.
C. int.
D. long.

Right Answer is:

SOLUTION

There are following tokens in C++:

i)  Keywords

ii) Identifiers

iii) Literals

iv) Punctuators

v) Operators


Q. 192659 What are Syntax Errors and Semantic errors?
A. char.
B. float.
C. int.
D. long.

Right Answer is:

SOLUTION

A syntax error is an error in the typing of the code or statement. A semantic error basically means invalid logic. For example:

In C++, we use "printf( )"

priintf( ) would be a syntax error, as the command was mistyped.

2+2=1 would be a semantic error because it is incorrect logic.


Q. 192660 The output of the below code is

int a=100, b=8 ;

cout << a / b << endl ;


A. 4.

B. 4.5.

C. 12.

D. 12.5.

Right Answer is: C

SOLUTION

Result of an integer division expression is always an integer.


Q. 192661 If I=50 then, the result of the expression I++<=50 , is


A. 50.

B. true.

C. 51.

D. false.

Right Answer is: B

SOLUTION

Post increment operator first prints the value and then increments.


Q. 192662 If initially I=20, then, the result of expression ++I<=20 , is


A. 20.

B. 21.

C. false.

D. true.

Right Answer is: C

SOLUTION

Pre increment operator first increments the value and then prints.


Q. 192663 The operation, in which the C++ compiler converts all the operands upto the type of the largest operand, is called


A. type casting.

B. type conversion.

C. type promotion.

D. integral promotion.

Right Answer is: C

SOLUTION

The sequence is long double, double, floats, unsigned long, long int, long and unsigned.


Q. 192664 Given int x, y, z, d; float p, q, r; double a, b, c ;

The example of invalid arithmetic expression is


A. (ceil (p) + x ) z.

B. c/a +p * x / z.

C. log (-18) + x/ y.

D. a + b * c /  d.

Right Answer is: C

SOLUTION

Logarithm of a negative number is not possible. So it is a domain error.


Q. 192665 Given int a, b, c, d ;  float p, q, r;  double x, y, z ;

The example of invalid arithmetic expression is


A. (sqrt (a) *b ) – c.

B. q (a + b- z /4 ).

C. a + b * c /  d.

D. p / q + a – c.

Right Answer is: B

SOLUTION

Here, operator is missing between q and a.


Q. 192666 Given int a, b, c, d ; float p, q, r; double x, y, z ;
The example of invalid arithmetic expression is


A. (sqrt (a) *b ) – c.

B. a + b * c / d.

C. x + * r.

D. p / q + a – c.

Right Answer is: C

SOLUTION

Here, two operators are in continuation.


Q. 192667 The result of the following two expressions, if initially I=20, is
1)++I<=20 2) I++<=20


A. true true.

B. false true.

C. false false.

D. true false.

Right Answer is: B

SOLUTION

Pre increment operator firsts increments the value and then prints the value, whereas post increment operator first prints the value and then increment it.


Q. 192668 if initially, the value of name =100, then the output of the below code fragment is cout << name -- ; cout cout << ++ name ;


A. 99 101.

B. 99 100.

C. 100 100.

D. 100 101.

Right Answer is: C

SOLUTION

Post decrement operator first prints the value , then decreases by 1,whereas pre increment operator first increases the value by 1 and then prints the value.


Q. 192669 The operator that evaluates to true, i.e., 1 if either of its operands evaluates to true is called as


A. logical AND (&&) operator.

B. logical NOT (!) operator.

C. logical OR (

Right Answer is: C

SOLUTION

The logical OR operator combines the two expressions which make its operands.


Q. 192670 The version, which uses the value of its operand and then changes it, i.e., it follows use-then-change rule is


A. postfix version.

B. prefix version.

C. logical version.

D. increment or decrement version.

Right Answer is: A

SOLUTION

Postfix version comes after the operand.


Q. 192671 The version, which first changes the value of operand and then uses it , i.e., it follows change then use rule, is called


A. postfix version.

B. prefix version.

C. logical version.

D. increment or decrement version.

Right Answer is: B

SOLUTION

Prefix version comes before the operand.


Q. 192672 The following code results int func=3;
cout << “ func=100 is “ << func=10 << “ n” ;


A. func=100 is 10.

B. func=100 is 3.

C. func=100 is 100.

D. func=100 is 0.

Right Answer is: A

SOLUTION

= is assignment operator which assigns value. Don’t confuse it with == operator, which is a relational operator and compares value.


Q. 192673 The following code results in
int func=3;
cout << “ func==100 is “ << func==10 << “ n” ;


A. func ==100 is 3.

B. 100.

C. func ==100 is 10.

D. func ==100 is 0.

Right Answer is: D

SOLUTION

== is a relational operator, which compares value and results in 1 if true and 0 if comparison is false.


Q. 192674 Data type identifies


A. type of data.

B. associate operations for handling it.

C. operations for handling data.

D. expressions.

Right Answer is: A

SOLUTION

A data type identifying one of various types of data, as floating-point, boolean or integer.


Q. 192675 Tokens are


A. Used for change.

B. Small gift given as a rememberance.

C. called Lexial Units or Lexial Elements.

D. none of the above.

Right Answer is: C

SOLUTION

C++ tokens (Lexical elements) are identifiers, keywords, literals, operators. It is the smallest element in a c++ program.


Q. 192676 Every function in C++  has its code written


A. within square brackets.

B. within curly braces.

C. within anglular brackets.

D. There is no bracket at all.

Right Answer is: B

SOLUTION

In C++ code is always written within curly braces { }.


Q. 192677 classes and structure are examples of


A. user-defined data types.

B. primitive data types.

C. basic data types.

D. fundamental data types.

Right Answer is: A

SOLUTION

User-defined data types are formed from primitive data types.


Q. 192678 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

According to hierarchy of precedence, parenthesis have more precedence than multiplication and division.


Q. 192679 Keywords are also called


A. literals.

B. reserved words.

C. seperators.

D. punctuators.

Right Answer is: B

SOLUTION

They are predefined reserved identifiers that have special meaning.


Q. 192680 A smallest unit in a program is called


A. token.

B. functions.

C. subclass.

D. class.

Right Answer is: A

SOLUTION

Token as a smallest element of a C++ program, that is meaningful to the compiler.


Q. 192681 Programs always begin with function


A. enter( )

B. output( )

C. start ( )

D. main( )

Right Answer is: D

SOLUTION

main() is the entry point of any C++ program.


Q. 192682 OXC is an


A. Integer.

B. Character constant.

C. Hexadecimal integer constant.

D. String Literal.

Right Answer is: C

SOLUTION

To specify a hexadecimal integer constant, start the hexadecimal sequence with a 0 followed by the character X (or x ). Follow the X or x with one or more hexadecimal characters (the digits 0 to 9 and the upper or lowercase letters A to F.


Q. 192683 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. 192684 What does cerr indicate ?
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:

SOLUTION

It stands console error. It is tied to standard error.


Q. 192685 Give three Bitwise operators.
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:

SOLUTION

Three bitwise operators are:

(i) &  (bitwise And)

(ii) ^ (bitwise exclusive OR also referred to as XOR)

iii) | (Bitwise OR)


Q. 192686 What is equal to = sign used for ?
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:

SOLUTION

Equal to (=) sign is used for:

i) Initialization of variables.

ii) As an Assignment operator in an expression.


Q. 192687 What is the use of a Comma , and a Semicolon ; ?
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:

SOLUTION

i) Comma is used in an argument list to seperate various elements of a list.

ii) Semicolon is used for termination of statement.


Q. 192688 What are cascading input and output operators?
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:

SOLUTION

Input Operator is >> 
and
Output Operator is <<


Q. 192689 What are logical errors ?
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:

SOLUTION

Logical errors produce incorrect output or undesired output when the syntax is correct. For example when we divide an integer value by 0 the result is not logical. It is a situation where logical error arises.

 


Q. 192690 List any 4 common program errors.
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:

SOLUTION

Following are the program errors:

1. Syntax error
2. Semantic Error
3. Type errors
4. Run time errors

 


Q. 192691 What is the role of a compiler ?
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:

SOLUTION

A compiler is a special program that processes statements written in a particular programming language and turns them into machine language. It analyses the program code for correctness.


Q. 192692 What do you mean by IDE?
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:

SOLUTION

The IDEs (Integrated Development Environment) are text editors and provide facilities for typing, editing, searching, compiling etc.


Q. 192693 What does int main( ) stand for ?
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:

SOLUTION

It is a main function of a program. All C++ programs begin their execution from main( ) function.


Q. 192694
Right Answer is: C

SOLUTION

The relational operators supported by C++ language are- < <= > >= != ==


Q. 192695 The output of a/b where a=15.9 and b=3 is


A. 5.1

B. 5.01

C. 5.3

D. 5.03

Right Answer is: C

SOLUTION

The output of a/b where a=15.9 and b=3 will be 5.3.


Q. 192696 Arithmetic operators in nature are


A. binary operators.

B. unary operators.

C. modulus operators.

D. logical operators.

Right Answer is: A

SOLUTION

Arithmetic operators are Binary in nature as they perform operation on two operands.


Q. 192697 Out of the following which expression is real


A. a%b

B. -k+y*y

C. -z

D. (amt+qnt*value)-bal

Right Answer is: D

SOLUTION

Value can contain a decimal number eg. 5.75 (as Rs/-)


Q. 192698 The conditional operator ?: requires


A. two operands.

B. three operands 

C. unary operand.

D.  

four operand.

 

Right Answer is: B

SOLUTION

The conditional operator ( ?: ) works on three operands that is why it is also called ternary operator. 


Q. 192699 Mixed mode expressions can be made up of


A. combination of arithmetic operators.

B. integers.

C. real constants/variable.

D. all of the above.

Right Answer is: D

SOLUTION

Expressions are the statements used to evaluate result.  Mixed mode expressions are  made up of integers , decimals , constants and variables.


Q. 192700 The process of converting one predefined type to another is


A. casting.

B. integral promotion.

C. type promotion.

D. type conversion.

Right Answer is: D

SOLUTION

It refers to changing an entity of one data type into another. This is done to take advantage of certain type of type hierarchies.


PreviousNext