Computer Science, asked by priyanka8230, 3 months ago

predict the output of the snippet
3. int p=6,q=15;
int r;
r = (p*q) + p/q;
System.out.println(r);​

Answers

Answered by boyMilleon
0

Answer:

use coding language or change your it's not classified on brainy

Answered by dreamrob
3

Given:

int p=6,q=15;

int r;

r = (p*q) + p/q;

System.out.println(r);​

Output:

90

Explanation:

p*q = 6*15 = 90

p/q = 6/15 = 0

r = (p*q) + p/q = 90 + 0 = 90

So, the output is 90.

Question for practice:

Predict the output of the snippet

int a = 50 , b = 15 , c = 22;

int x , y , z;

x = a + b * c;

y = a / b * c;

z = x % y;

System.out.println(x);

System.out.println(y);​

System.out.println(z);​​

Similar questions