Answer to Question #260781 in C++ for ace

Question #260781

b) Explain the following definitions. For those that are illegal, explain what’s wrong and how to



correct it.




i) const long large;



ii) double salary = wage = 9999.99;



iii) int i = 3.14;



iv) short int big = 40000;



v) int a = b = c = d

1
Expert's answer
2021-11-04T00:24:23-0400

i) const long large;

The definition is wrong because a constant variable must be initialized.


ii) double salary = wage = 9999.99;

The definition is wrong since wage was not declared.


iii) int i = 3.14;

The definition is wrong since an integer variable has been initialized with a floating point value.


iv) short int big = 40000;

The definition is correct.


v) int a = b = c = d

The definition is incorrect since the variables b,c,d were not declared.



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS