Question
1) Which is a good choice of identifier? A) _abc B) RATE C)x D)A 2) Before a variable in C++ is used, it must be
1) Which is a good choice of identifier?
A) _abc B) RATE C)x D)A
2) Before a variable in C++ is used, it must be
A)defined B)initialized C)contain only letters, digits and underscores D)used in some expression
3) A L-value is
A)assigned a value B)an expression that can only be placed on the left of any operator such as +,*,/,etc C)can never have a value fetched from it D)is designed for use by a left-handed person
4) Which is a C++ keyword?
A) total_weight B)number_of_bars C) .a D) while
5) An r-value is
A) can never be assigned a value B) is designed for use by a right-handed person C) can have a value fetched from it D) an expression that can only be placed on the right of any operator such as +,*,/,etc
6)In C++, a variable that has been defined but not initialized may
A) be used in any way any identifier can be used B) not be used at all C)not be used as an r-value D)not be used as an L-value
7)Which is a legal identifier?
A) xy_z B) xyz! C)9xyz D) X+yz
8)Which statement is correct?
A)In C++ the compiler will infer the type intended for a variable from the context in which the variable occurs B)A C++ declaration is a definition but does not allocate storage for an identifiers value (or functions body etc.) C)A C++ declaration introduces only an identifiers spelling and specifies its type D) In C++ the variables Alpha, ALPHA and AlphA are the same identifier
9)Which is an invalid definition with initialization? (Consider each line to be in a different scope so there is no multiple definition of identifiers)
A) int count=0, limit(19); B) int namespace(0); C) int count(0), limit(19); D)int count=0, limit=19;
10)Which is the smallest data type that can be used to store a integer number whose range is -10,000 to 10,000?
A) short B)unsigned long C)char D)int
11) In the C++ statement:
x = m - 3 * n + 4 / n;
assume x, m and n are int variables. Which operation is performed first?
A)+ B) * C) / D)-
12)Which include statement is required in order to get the statement below to work:?
time = sqrt(2 * height / 32.2);
A) #include "stdafx.h" B) #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started