Menu
Question Index
...

What will be the output of the following program?

class MyClass
{
    public static void main(String s[])
    {
        int i = 34.0;
        int j = 7;

        int k = i % j;

        System.out.println("k = " + k );

    }
}


k = 4
The program does not compile.
k = 6
k = 0

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