Question: 1 2 ) What is in variable x after the following statements are executed? int x = 2 ; x * = x + 1

12) What is in variable x after the following statements are executed?
int x =2;
x *= x +1;
A)3 B)6 C)2 D)4 E)5
13) What is the value of (double)5/2?
A)2 B)33 C)3.0 D)2.0 E)2.5
14) What are the values of a and b after the following statements are executed?
int a =3;
int b = a--;
A) a=3, b=3 B) a=3, b=2 C) a=2, b=3 D) a=2, b=2
15) What is the value of i after this statement is executed?
double d =123.784;
int i =(int) d;
A) Error B)123.8 C)124 D)123 E)123.784

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 Programming Questions!