Menu
Question Index
...

What is the output of the following program?

public class GuessOutput {
    public static void main(String[] args) {
        int a = 56;
        int b = -8;
        int c = a % b;
        int d = b % a;
        System.out.println(c + ", " + d);
    }
}


-7, -8
-0, -8
-0, 8
0, -8
0, 8

Doubts

Problems

Topic: Modulus Operator In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App