Question: //================================================== /* * operators and expressions */ int e = 5; int num = ++e - 8 % 3; System.out.println(The num is + num);

//==================================================

/*

* operators and expressions

*/

int e = 5;

int num = ++e - 8 % 3;

System.out.println("The num is " + num);

/*

* rewite the expression (++a - 8 % 3) to compute 'num' without using

* increment operator where num should still evaluate to 4.

*

* What is the value of variable 'a' after computing num?

* answer:

*/

/*

* Write Java code to execute the following fraction,

* if a = 3 , b = 5, c = 6, d = 4 (declare these as int type variables).

* numerator = a * b / (d + c)

* denominator = c % d - b + a

* results = numerator/denominator.

* output 'results'

*/

/* Expected output should be -0.1666666716337204

* Show your hand calculation to verify correctness of 'results'.

* If the output is incorrect, fix the expression to get the correct 'results'.

*/

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!