Answer all C++ Problems: Describe what will happen and the results of the operat
ID: 3551226 • Letter: A
Question
Answer all C++ Problems:
Explanation / Answer
4]
a)
sum will be equal to 11.000
10 ie an integer value is added according to type conversion rules it gets added to float
b)
same goes for this too
3 gets converted to float type
so average = 7.66667
c)
(15.0/7.0) =2.14 --- float/float -- so ans float
(15/7) =2 ...... int/int so ans =int
but now 2.14 gets added to 2 which is fine by type conversion rules
so ans =4.14
5]
a)
assignment operator
b)
else without if
c)
scope
d)
one
e)
comments
6]
Escape Sequences - These are character combinations that comprise a backslash () followed by some character. They give results such as getting to the next line ( ) or a tab space ( ). They are called escape sequences because the backslash causes an "escape" from the normal way characters are interpreted by the compiler. You must have seen these in cout statement.
Constant Expression - A constant expression can be evaluated at compile time. That means it has no variables in it. For example:
is a constant expression.
Manipulators - Manipulators are functions specifically designed to be used in conjunction with the insertion (<<) and extraction (>>) operators on stream objects, for example:
7]
union is invalid
best Price is invalid - space cant be used
letter-grade is invalid - -cant be used
char average cant be declared as it is initialised in float
cout << boolalpha; Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.