Computer Science, asked by seemakotharinitin, 4 months ago

Show the steps and write the output for the following.
int a=3,b=5, d,r;
d=b/a;
r=b%a;
System.out.print(“Result 1:”+d);
System.out.println(“Result 2:”+r);

Answers

Answered by jyodee75
0

Answer:

Result 1:1.666667Result 2:2

public class x

{

public static void main()

{

int a=3,b=5,d,r;

d=b/a;

r=b%a

System.out.print("Result 1:"+d);

System.out.println("Result 2:"+r);

}

}

Explanation:

in the program, d is the value of the quotient when 5 and 3 are divided and r is the value of the remainder when 5 and 3 are divided.  and in the end there is sop and not sopln, so the output will be on the same line.

Similar questions