Menu
Topics Index
...
`

Variable Declaration2011


If you need explanation Read this topic

If you need Answer Take test on this topic

Variable Declaration2011
What will be the output of the following program?
public class Rules {
    public static void main(String[] args) {
    System.out.println(10 * 5 + 100 * (25 * 11) / (25 * 10) * 10 - 5 + 7 % 2);
    int zx = (10 * 5 + 100 * (25 * 11));
    int yz = ((25 * 10) * 10 - 5 + 7 % 2);
    System.out.println(zx / yz);
    }
}

A. 1046
1046
B. 1046
10
C. 1146
1146
D. 1146
11
E. Some other output
F. Compilation Error or Runtime Error
Topic: Modulus Operator In Java

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

ans D ,in arthmatic operations first will do the multiplication and next is division and then addition and finally substraction, so first SOP returns 1146 ,and secon SOP prints 11, by caluclating division.

Posted by Damu Surya    2014-07-11 13:31:57


ans is D first sop value is 1146 and 2nd sop value is 11

Posted by Naga Sinst    2014-07-11 13:33:48


ans d bcz
first print stmt prints value 1146
zx=27550
yz=2496
zx/yx=11

Posted by Pooja Singh    2014-07-11 13:33:50


ans "d"

Posted by Sai Kumar    2014-07-11 13:35:25


ans is d it uses rule of associativty and operator is come in order of %,/ * +_ and calculate from left to right in case =

Posted by Dinesh Saini    2014-07-11 15:48:02


d

Posted by Arul Palanisamy    2014-07-12 05:11:25


I workd on it

Posted by Arul Palanisamy    2014-07-12 05:11:38


the ans is d

Posted by Arul Palanisamy    2014-07-12 05:11:49


d

Posted by Arul Mani Dubey    2014-07-12 08:19:17


Congratulations Damodar U Ukkala. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-07-14 11:57:51


Merit Campus me too gave right ans......

Posted by Arul Palanisamy    2014-07-14 11:59:40


© meritcampus 2019

All Rights Reserved.

Open In App