Evaluate the following c++ expressions where a,b,c are integers and d,f are floating point numbers . The values are : a=4,b=4,and d=1.5. (A) c=a+++b*++d (B) f=b*b++-++a
Answers
Answered by
0
See the pic below it will help you
Attachments:
Answered by
0
The value of c=14 and f=14; are printed in the console window.
Explanation:
- In the option(A) part the expression is c=a+++b*++d firstly the ++d is executed it means the value of d is increases by 1 and it becomes 2.5 after that b*++d operation is executed it means the value of b is multiplied by 2.5 which is the value of d variable so it gives 4*2.5=10.0 finally a+++b this operation is executed as a++ is post increment so it assign the value first then perform operation so 4+10=14.0 .after that the value of a is increases by 1 it becomes 5 and 14 is store in c variable.
- In the second option(B) f=b*b++-++a .In this =b*b++ is executed and it gives 4*5 i.e 20 after that ++a is executed it gives 6 as value of a is 5 in previous statement so f will hold 20-6=14.
Learn More :
- brainly.in/question/3407003
Similar questions