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

PreviousNext

Q. 192701 The shorthand for assignment statement is


A. variable = variable operator expression.

B. var operator expression.

C. expression operator variable.

D. variable operator = expression.

Right Answer is: D

SOLUTION

Shorthands simplify the coding of a certain type of assignment statement. Example: a+=143; is equal to a=a +143;


Q. 192702 Type casting is


A. removing type.

B. is same as type conversion.

C. implicit conversion.

D. explicit conversion of an operand to specific type.

Right Answer is: D

SOLUTION

A explicit type conversion is user-defined that forces an expression to be of specific type. Itis done as (type) expression.


Q. 192703 Explicit type conversion is


A. conversion of int into signed int.

B. conversion of int into unsigned int

C. user defined.

D. compiler defined.

Right Answer is: C

SOLUTION

The explicit conversion of an operand to a specific type is called type casting.


Q. 192704 The output of the following code will be: int a,b=2,k=0; a=b*3+k+8-b+6/8; cout << a;


A. 24

B. 18

C. 12

D. 20

Right Answer is: C

SOLUTION

The statement a=b*3+k+8-b+6/8; will assign the value 12 in the variable a. Hence, the output of the code will be 12.


Q. 192705 Which is the statement that is dynamically initialized out of the following


A. float ft=25.345;

B. char ch=’b’;

C. float avg=sum/count;

D. int a=15;

Right Answer is: C

SOLUTION

In dynamically initialized Statement assignment statement is part of the declaration  


Q. 192706 Expressions can be


A. arithmetic.

B. relational.

C. arithmetic and relational.

D. arithmetic,relational, logical, compound etc.

Right Answer is: D

SOLUTION

5>6 || 5 <6 will evaluate to truth value of 1 implying yes since one portion of the expression is true.


Q. 192707 An expression is composed of


A. operators.

B. constants.

C. variables.

D. all of the above.

Right Answer is: D

SOLUTION

An expression is a sequence of operators, operands and constants.  An expression is evaluated to produce the result. 


Q. 192708 unary + and unary – precede an


A. operator.

B. operand.

C. expression.

D. functions.

Right Answer is: B

SOLUTION

Unary means one. These operators perform on one operand. Eg a= -16 means a=16


Q. 192709 Conversion of all operands upto the type of largest operand is


A. integral promotion.

B. type casting.

C. type promotion.

D. type conversion.

Right Answer is: C

SOLUTION

Conversion of all operands up to the type of largest operand is called Type promotion. In type promotion, the compiler automatically expands the binary representation of objects of integer or floating-point types. Type promotions are commonly used with types smaller than the native type of the targeted element.


Q. 192710 Literal are the


A. arithmetic constants.

B. real variables 

C. constants

D. integer operators.

Right Answer is: C

SOLUTION

Literals are the most obvious kind of constants. They are the smallest unit of the program. In C++ literals are mainly classified into following types: Integer literal, Float literal , character literal and String literal.  


Q. 192711 Expressions can be


A. only arithmetic.

B. only relational.

C. arithmetic and relational.

D. arithmetic, relational, logical, compound, etc.

Right Answer is: D

SOLUTION

Example of an expression: 5>6 || 5


Q. 192712 *ab is a


A. fixed variable.

B. constant.

C. pointer.

D. operator.

Right Answer is: C

SOLUTION

Pointer is a variable that stores the reference to another variable.


Q. 192713 The conditional operator ?: requires


A. two operands.

B. three operands.

C. one operand.

D. four operands.

Right Answer is: B

SOLUTION

It is a ternary operator, i.e., it requires three operands to operate on.


Q. 192714 Define a variable?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

A variable refers to a storage area whose contents can vary during programming.Variables should be known to the program before being used.


Q. 192715 How are single line and multi line block comments written?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Single line comments begin  by //  sign  while multi line or block comments can be done using /*….*/.

for examp
le

// This is C++ document

/* This is C++ document
     Author name: XYZ */
    

 

 


Q. 192716 Name two basic streams of c++ .
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Basic streams used in c++ are:

(1) istream(cin): - used for input.

(2) ostream(cout): - used for output.


Q. 192717 Why is include < iostream.h >  written with all programmes  ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

< iostream.h > refers to a header file of iostream library which provides input and output functions. The header file Input/Output is included as these facilities are not defined within c++ language.They are implemented within a component of C++ standard liabrary.


Q. 192718 What does Return 0; indicate ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

It makes the function like main( ) finish and return a value. Returning 0 is the most usual way of telling that the program has terminated and has not found any errors.

 


Q. 192719 Give any 2 examples of Unary Operators.
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

These are the examples of Unary Operator:

++ Increment Operator- for incrementing the value.
-– decrement operator- for decrementing the value.


Q. 192720 What are Binary Operators ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

The operators that require two operands to operate upon are called as binary operator.


Q. 192721 What is the sizes of following example of string literals ?
“Marks”
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

“marks” the size is 6, (5 for each character and 1 for special character '0' ).


Q. 192722 What is a stream ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

A stream is a sequence of bytes and at lowest level,files are interpreted as stream of bytes.


Q. 192723 What are identifiers ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Identifiers are the building blocks and they are used in general terminology. They are names given to different parts of a program, viz variables, objects, classes, functions, arrays etc.

 


Q. 192724 What is a token ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Individual words in a passage of text, punctuation marks are called tokens. It is the smallest individual unit in a program.

 


Q. 192725 What is  Character Set?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Character set is a set of valid characters that a language can recognize.


Q. 192726 Write a short note on Hexadecimal Integer constants?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

A sequence of digits preceded by 0x or OX is taken to be an hexdecimal integer. Eg: 12 will be written as OXC in hexadecimal integer.
The suffix l or L and u or U attached to any constant forces it to be represented as a long and unsigned respectively.


Q. 192727 What are Literals?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Literals are also referred to as constants. They never change their value during program run. There are several kinds of literals in C++ eg:-integer-constant, character-constant.

 


Q. 192728 What are keywords ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Keywords are the words that convey a special meaning to the language compiler.They are reserved words for special purpose and must not be used as normal names. There are a large number of keywords. Eg: char, integer, double etc.


Q. 192729 What is C++ Character set ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

The C++ character set is-

 

1. Letters (A to Z, a to z ).

2. Digits (0 to 9).

3. Special Symbol (Space =  + * -  / ^ ( ) [ ] { } < > : ; “ ‘ , . ? | ! @ # $  % ^ & _ (underscore)).

4. White space, Blank space, Horizontal tab, Carriage return, New Line, form feed.

5. Other characters.

C++ can process 256 ASCII Characters as data or as String literal


Q. 192730 Write cout and cin statements to enter a number and then display the number entered.
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

The code is as follows:
            cout<< "enter any number";

          cin >> a;

          cout << "the number entered is"  << a; 


Q. 192731 Point out the errors in the following program.
include < iostream.h >           int main( )           {           cout << find me ;                return 0               }  
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

i) Hash or pound sign missing in the 1st line.

ii) cout statement is within double quote (" ").

iii) return 0 should have a termination sign (;).


Q. 192732 What is code generation ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

Compiler translates the correct program into object or assembly instruction text. This process of translation is called code generation.The program execution takes place after the code is generated.


Q. 192733 What are Semantic Errors and Type errors ?
A. two operands.
B. three operands.
C. one operand.
D. four operands.

Right Answer is:

SOLUTION

a) Semantic error- This error occurs when statement are not meaningful. The word Semantic means a set of rules which give meaning to a statement.
Eg:-A+B=c;

Here, the expression A+B must be on the right side of the equal sign(=) and the right statement is c=A+B;
 

b) Data has associated data type.Eg the number 5 is an integer, ‘b’ is a Character constant and ‘Allah’ is a string. If a function is given a wrong data type, the compiler displays type error.

 


Q. 192734 Symbols that represents specific operations are called:


A. +,-,* and /

B. Expressions

C. Operands

D. Operators

Right Answer is: D

SOLUTION

Operators are the symbols that represents specific operations. Arithmetic operators carray out arithmetic for C++.


Q. 192735 It is an operator that returns the size of variable:


A. int 

 

B. return

C. void

D. sizeof()

Right Answer is: D

SOLUTION

The sizeof() is a unary compile time operator that returns the length of a variable, array, object or a data type in bytes.  


Q. 192736 Group of expressions separated by commas is evaluated in:


A. left-to-right sequence 

B. right-to-left sequence 

C. mid-to-right sequence 

D. left-to-mid sequence 

Right Answer is: A

SOLUTION

A comma operator is used to string together several expressions. The group of expressions separated by commas(,) is evaluated left-to-right in sequence and the result of the right most expression becomes the value of the total comma-separated expressions.


Q. 192737 Type of expression that can either be integer expression or real expression is:


A. Arithmetic expression

B. Explicit conversion

C. Character expression

D. Implicit conversion

 

Right Answer is: A

SOLUTION

Arithmetic expression can either be integer expressions or real expressions. sometimes a mixed expression can also be formed which is a mixture of real and integer expressions.


Q. 192738 The comma operator


A. strings together several expressions.

B. is not used in expressions.

C. may or may not be used between expressions.

D. styling tool.

 

Right Answer is: A

SOLUTION

In C++ programming languages, the comma operator is a binary operator that evaluates its first operand and discards the result, and then evaluates the second operand and returns this value. It is basically used to strings together several expressions.


Q. 192739 The order of evaluation for logical operators is


A. not-or-and

B. and -not-or

C. or-and-not

D. not- and –or

Right Answer is: D

SOLUTION

The order of evaluation for logical operators is NOT (!) - AND(&&) –OR(||).


Q. 192740 The shorthand for assignment statement is


A. var =expression.

B. var

C.  

var>expression.

 

D. var  oper = expression.

Right Answer is: D

SOLUTION

C++ offers special shorthands to simplify simplify a certain type of assignment statements. The general form of is: var oper = expression


Q. 192741 Unary operator works on the:


A. Single operand

B. Two operand

C. Multiple operand

D. zero operand

Right Answer is: A

SOLUTION

A unary operator requires a single operand. Unary +, Unary -, ++, --, sizeof etc. are some unary operators in C++.


Q. 192742 After executing the statement i=15 ++i<=15; the value of i would be:


A. 0 i.e, false

B. 1 i.e, true

C. 16

D. 15

Right Answer is: A

SOLUTION

After executing the statement i=15 ++i<=15; the value of i would be  0 i.e, false.


Q. 192743 int ch=25; cout<<++ch<< ch;
the output will be


A.

 26

 26 

B.

   25

 26

C.

25

25

D.

25

24

Right Answer is: A

SOLUTION

Such expressions are legal but confusing.


Q. 192744 x !=y implies


A. same as x=y.

B. x equal to y.

C. <> implies not equal to.

D. x not equal to y

Right Answer is: D

SOLUTION

The != is a relational operator which indicates not equal to. Therefore , the statement x !=y implies x not equal to y.


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


A. changing type.

B. integral promotion.

C. type promotion.

D. type conversion.

Right Answer is: D

SOLUTION

The process of converting one predefined type to another is called type casting. 


Q. 192746 Type casting is


A. removing type.

 

B. is same as type conversion.

C. implicit conversion.

D. changing an entity of a data type from one type to another.

Right Answer is: D

SOLUTION

Type casting is changing an entity of a data type from one type to another as per the need of program.


Q. 192747 Explicit type conversion is


A. conversion of int into signed int.

B. conversion of int into unsigned int

C. is user defined

D. is compiler defined

Right Answer is: C

SOLUTION

Changing one type of value to another type is called type conversion. The explicit type conversion is done by the user as per the need of the program.


Q. 192748 In the following statements, which is the invalid arithmetic expression


A. x/z+a-c

B. (c+b)*x/y+p*ab

C. p%q

D. (sqrt(b)*a)-g

Right Answer is: C

SOLUTION


Q. 192749 State the invalid logical expression out of the following


A. (x>y)&&(c+d)>y

B. x

Right Answer is: D

SOLUTION

In the  statement:  x<=z|b; one logical OR operator is missing therefore it is an invalid logical expression. The correct expression will be: x<=z||b;


Q. 192750 All assignment operators have


A. a higher precedence than conditional operator.

B. a higher precedence than logical operator.

C. a lower precedence than ?

D. higer precedence than ?

Right Answer is: C

SOLUTION

? is an alternate for if operator.  


Q. 192751 Variables are initialized using


A. expression.

B. assignment statement.

C. relational operators.

D. unary operator.

Right Answer is: B

SOLUTION

int a == 5a in an initialized variable


Q. 192752 In the statement a=bcd, bcd  can be


A. constant.

B. variable.

C. expression.

D. all of the above.

Right Answer is: D

SOLUTION

a=5 or a=b or a=a*b or a=(c+b)* 3


Q. 192753 What is the output of the unary  prefix x and y here 
int x = 5, y = 5;   
cout << ++x << " " << --y


A. 5 and 5

B. 7 and 6

C. 6 and 4

D. 4 and 6

Right Answer is: C

SOLUTION

Prefix implies first change the value of x and then use it in the expression


Q. 192754 Error in the following code while (i<10) && (i>24) is


A. the logical operator && cannot be used with while statement.

B. the while loop is an exit condition loop.

C. the test condition is always false.

D. the test condition is always true.

Right Answer is: C

SOLUTION

Here, the condition controlling the execution of the loop is always false. It will never be true.


Q. 192755 A continue statement causes execution to skip to


A. return 0; statement.

B. the first statement after the loop.

C. the statement following the continue statement.

D. the next iteration of the loop.

Right Answer is: D

SOLUTION

Continue statement ends the current iteration of a loop. Program control is passed from the continue statement to the end of the loop body and continue with next iteration.


Q. 192756 A case label contains the word case followed by


A. an integer constant expression and a colon.

B. a character constant expression and a colon.

C. an integer constant expression and a semi-colon.

D. a character constant expression and a semi-colon.

Right Answer is: A

SOLUTION

A case label contains the word case followed by an integer constant expression and a colon. The value of each integer constant expression must represent a different value.


Q. 192757 The body of switch statement consists of a


A. font label, an optional default label, a list of statements.

B. case label, a case expression, a list of programs.

C. font label an optional default label, a case expression, a list of statements.

D. case label an optional default label, a case expression, a list of statements.

Right Answer is: D

SOLUTION

switch statement is a selection statement that let us transfer control to different statements within the switch body depending on the value of the switch expression. If the value of the switch expression equals the value of one of the case expressions, the statements following that case expression are processed. If not, the default label statements, if any, are processed.


Q. 192758 The syntax of switch statement is


A. switch ( expression ) switch.

B. switch ( expression ) statement switch.

C. switch ( expression ) statement.

D. switch (statement) expression.

Right Answer is: C

SOLUTION

The switch statement executes one or more of a series of cases, based on the value of a controlling expression. The switch statement has the following syntax: switch (expression) statement.


Q. 192759 The difference between looping statements and selection statement is


A. loops run until the exit condition is met.

B. loop tests for static condition one time.

C. loops are conditional statements.

D. loops grab information from fields and display it.

Right Answer is: A

SOLUTION

The loop variable can change in the loop to cause exit. Looping statements are statements that won't stop its process, unless it satisfies its condition, while selection statements will be executed if the input matches one of the selections. The selection that matches the input will be processed.


Q. 192760 The maximum number of case statements that a switch statement can have, is


A. 50.

B. 100.

C. 153.

D. 257.

Right Answer is: D

SOLUTION

The ANSI standard specifies that a switch can have upto 257 case statements. But, one must limit the number of case statements to a smaller amount for the sake of efficiency.


Q. 192761 The expression which changes the value of loop variable is known as


A. update expression.

B. true expression.

C. test expression.

D. initialization expression.

Right Answer is: A

SOLUTION

The update expression is executed, at the end of the loop after the loop body is executed.


Q. 192762 An expression whose truth value decides whether the loop-body is executed or not, is


A. update expression.

B. true expression.

C. test expression.

D. initialization expression.

Right Answer is: C

SOLUTION

If the test expression evaluates to true,i.e.,1, the loop-body gets executed, otherwise the loop is terminated.


Q. 192763 The number of times the initialization expression is executed, is


A. one.

B. two.

C. three.

D. four.

Right Answer is: A

SOLUTION

The initialization expression gives the loop variable their first value. The initialization expression is executed only once, in the beginning of the loop.


Q. 192764 The four elements which control a loop are


A. initialization expression, test expression, recover expression and loop- body.

B. initialization expression, test expression, out expression and loop- body.

C. initialization expression, test expression, date expression and loop-body.

D. initialization expression, test expression, update expression and loop-body.

Right Answer is: D

SOLUTION

Every loop has its elements that control and govern its execution. A loop has four elements that have different purposes. These elements are: initialization expression, test expression, update expression and loop-body.


Q. 192765 The syntax of the while loop is


A. while(expression) loop-body.

B. loop body while(expression).

C. while(loop body (expression)).

D. loop body do-while (expression).

Right Answer is: A

SOLUTION

The syntax is while (expression) loop-body. Here, the loop body may contain a single statement, a compound statement or an empty statement. While is entry dependant loop, due to which expression is defined before the body of the loop.


Q. 192766 The loop which is contained in another loop is known as


A. do-while loop.

B. container loop.

C. eccentric loop.

D. nested loop.

Right Answer is: D

SOLUTION

A nested loop is a loop within a loop, an inner loop within the body of an outer one.


Q. 192767 The entry control loops are


A. for and while.

B. for and while-do.

C. while and while-do.

D. for, while and while-do.

Right Answer is: A

SOLUTION

In an entry-control loop, the test expression is evaluated before executing the body of the loop,i.e., before entering into a loop. The for and while loops are the entry-control loops.


Q. 192768 The number of jump statements in C++ is


A. three.

B. four.

C. five.

D. six.

Right Answer is: B

SOLUTION

C++ provides four jump statements: return, goto, break and continue.


Q. 192769 The program area inside which a variable can be accessed, is known as


A. program’s limit.

B. variable’s limit.

C. variable’s scope.

D. program’s scope.

Right Answer is: C

SOLUTION

C++’s rule regarding variables access states that, a variable can be accessed only in the block where it has been declared.


Q. 192770 The input/output facilities in C++ program is provided by


A. stdio.h.

B. getch.

C. iostream.h.

D. string.h.

Right Answer is: C

SOLUTION

Input/Output facilities are not defined within the C++ language, rather are implemented through a component of C++ standard library, iostream.h.


Q. 192771 The exit-control loop among the following is


A. for loop.

B. while loop.

C. do-while loop.

D. exit loop.

Right Answer is: C

SOLUTION

Do-while is an exit-control loop in which the test expression is evaluated before exiting from the loop.


Q. 192772 The loop in which the test expression is evaluated before entering into a loop, is


A. start control loop.

B. entry control loop.

C. end control loop.

D. exit control loop.

Right Answer is: B

SOLUTION

In an entry-control loop, the test expression is evaluated before executing the body of the loop, i.e., before entering into a loop.Based on its value, it is decided whether the loop will be executed or not.


Q. 192773 The syntax of for loop is


A. for( initialization expression; test expression; update expression).

B. for( initialization expression: test expression: update expression).

C. for( initialization expression, test expression, update expression).

D. for( initialization expression/ test expression/ update expression).

Right Answer is: A

SOLUTION

In a for loop, all its loop control elements are gathered at one place. In the syntax, semi-colons are used.


Q. 192774 All assignment operators have


A. a higher precedence than conditional expression.

B. a higher precedence than logical operator.

C. a lower precedence than conditonal expression.

D. higer precedence than conditional expression.

Right Answer is: C

SOLUTION

conditional expression (?:) has higher precedence than assignment operators and comma operator.


Q. 192775 Variables are initialized using


A. expression.

B. assignment statement.

C. relational operators.

D. unary operator.

Right Answer is: B

SOLUTION

int a = 5; Here a in an initialized variable.


Q. 192776 Among the following, the dynamically initialized statement is


A. float ft=25.345;

B. char ch='b';

C. float avg=sum/count;

D. int a=15;

Right Answer is: C

SOLUTION

Rest three statements are initialized with the constant expressions. Hence, static initialization. In float avg=sum/count; the values are assignede at run time. Hence, it is dynamic initialization.


Q. 192777
A. =
B. &&
C. = =
D. ||

Right Answer is: C

SOLUTION

&& and || are logical operators, whereas = is an assignment operator.


Q. 192778 Unary + and unary - precedes an


A. operator.

B. operand.

C. expression.

D. functions.

Right Answer is: B

SOLUTION

Unary means one. These operators perform on one operand. Eg a= -16 means a=16


Q. 192779 sizeof() operator is a


A. unary compile time operator.

B. binary compile time operator.

C. unary run time operator.

D. binary run time operator.

Right Answer is: D

SOLUTION

sizeof() operator is a unary compile time operator that returns the length (in bytes) of the variable or parenthesized type specifier that it precedes.


Q. 192780 The correct precedence of operators from higher to lower level is


A. ==, !=, &&,

Right Answer is: A

SOLUTION

The correct precedence is == (equal to) != (not equal to) && (logical AND) || (logical OR) ?: (conditional operator) comma operator


Q. 192781 The operator used to string together several expressions, is


A. addition operator.

B. concatenation operator.

C. comma operator.

D. sizeof() operator.

Right Answer is: C

SOLUTION

The group of expressions separated by comma operator are evaluated left-to-right in a sequence.


Q. 192782
A. !, &&, ||
B. &&, ||, !.
C. ||, !, &&.
D. &&, ||, !.

Right Answer is: D

SOLUTION

According to the precedence of operators, logical not (!) come first, then logical AND (&&), and then logical OR (||).


Q. 192783 abc and abc ++1 are


A. different in values from  each other.

B. same values.

C. constants.

D. one is real and other is integer.

Right Answer is: B

SOLUTION

++1 is an increment operator and it is used in postfix sense here.Therefore value of abc will be incremented only after the operation has been  performed.


Q. 192784 Constant values or identifiers are


A. rvalue.

B. lvalue.

C. stored.

D. (l+r) values.

 

Right Answer is: A

SOLUTION

Constant values or identifiers are rvalue. The rvalue represents the row value stored by a variable.


Q. 192785 While casting, choose a type which is greater


A. to avoid overflow.

B. it is not important to make both types similar.

C. int and double need not be changed.

D. to avoid underflow.

 

Right Answer is: A

SOLUTION

Casting refers to changing the one type of value into other data type. While casting, we should choose a type which is greater to avoid any kind of overflow.  


Q. 192786 what will be the result of following expression if
a=3, b=6 , c=4 , d=2 ?
a+b>c && b-c < d
Right Answer is: A

SOLUTION

The output of the following code would be :1 because the result of the && operator would be false (0) which is combined with the true value of || operator. Hence, 0 || 1 would result in 1.


Q. 192787 The statement int *ab; represents a


A. variable.

B. constant.

C. pointer.

D. an operator.

Right Answer is: C

SOLUTION

The statement int *ab; represents a pointer declaration. The pointer declaration always starts with an asterisk(*) sign.


Q. 192788 Priority over any mathmetical operator is first given to


A. addition.

B. subtraction.

C. parenthesis ( ).

D. multiplication and division.

Right Answer is: C

SOLUTION

The precedence rule  of a language specify the order of operator evaluation when two or more operators with different precedence are adjacent in an expression. The parenthesis operator has the highest precedence than the other operators given in the list.


Q. 192789 The variable that is declared and initialized in separate statements, is


A. initialized variable.

B. uninitialized variable.

C. assigned variable.

D. an rvalue.

Right Answer is: B

SOLUTION

Example: int i; Here i is uninitialized variable, since its value has not been initialized so far.


Q. 192790 The function that returns the absolute value is


A. absol().

B. fabs().

C. abs().

D. absolute().

Right Answer is: B

SOLUTION

Example fabs (-1.0) gives 1.0


Q. 192791 In the following statements, the valid arithmetic expression is


A. x/z+a-c

B. (c+b)*/ x/y+p*ab

C. p%a+- q

D. (sqrt(-b)*a)-log(-g)

Right Answer is: A

SOLUTION

Two operators cannot occur in continuation and logarithm of a negative number is not possible.


Q. 192792 The logical expression for "salary is in the range 3000-5000 or friend is 1", is


A. salary<=3000

Right Answer is: B

SOLUTION

The logical expressions are combination of constants, variables, logical and relational operators.


Q. 192793 Type promotion implies


A. process of converting one predefined type into another.

B. explicit conversion.

C. coversion of all operands upto the largest operand.

D. implicit conversion.

Right Answer is: C

SOLUTION

It is a step-by -step process. It occurs whenever a variable or expression of a smaller type is converted to larger type.


Q. 192794 What is Data Processing ?
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

Data Processing is evaluation of data by means of:- 
   
 i) Mathmetical operators
 ii) Relational and
 iii) Logical Operators


Q. 192795 What is type casting ?
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

Converting an expression of a given type into another type is known as type-casting. Type- casting are of two types -

(i) Implicit Type-casting

(ii) Explicit Type-casting


Q. 192796 If j=25 initially, what will be the result of following two expressions 
         i)  ++j<=25          ii) j++ <= 25
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

i) 0 ie false    
        ii) 1 ie True


Q. 192797 What is the function of  logical Not  ?
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

The logical NOT operator (!) works on single expression or operand. It is a unary operator. It negates or reverses the truth value of the expression.


For example - if the expression is true, then !expression is false and vice versa.


Q. 192798 Describe the prefix forms of operators ?
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

When an increment or decrement operators precedes its operand, it is in Prefix form. In this, C++  performs the increment or decrement operation before using it.


Q. 192799 Name the header file for built in mathematical functions in C++ ?
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

The built in mathematical functions are stored in header file .


Q. 192800 If fee is =25 what will the following code segments display ? 
i) Cout<< fee- - ; 
ii) Cout<<++ fee ;
A. process of converting one predefined type into another.
B. explicit conversion.
C. coversion of all operands upto the largest operand.
D. implicit conversion.

Right Answer is:

SOLUTION

i) 25
ii) 25


PreviousNext