Assume that x and y are already defined as being of type int

Assume that x and y are already defined as being of type int . Write a single expression that will add 7 times the sum of x and 4 to y. Add 1 to x afterwards. (x changes - use one expression ).

Solution

Answer: Single expression is as folllows

y = 7 * (x + 4); //adding x value with 4 and after that multiplying with 7

x = x + 1; //Adding 1 to x value and reassigning the value to x.

Assume that x and y are already defined as being of type int . Write a single expression that will add 7 times the sum of x and 4 to y. Add 1 to x afterwards. (

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site