Menu
Question Index
...

What will be the output of the following program?

public class DayMonthDemo
{
    public static void main(String args[])
    {
        int num = 69;
        int days = num % 30;
        int month = num / 30;
        System.out.println(month + " Month and " + days + " days");
    }
}


3 Month and 9 days
2 Month and 9 days
0 Month and 29 days
0 Month and 69 days
Compilation Error or Runtime Error

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