Menu
Topics Index
...
`

Arthmetic Operators


If you need explanation Read this topic

If you need Answer Take test on this topic

Arthmetic Operators
What will be the output of the following program?
public class Rules {
    public static void main(String[] args) {
        System.out.println(10 * 5);
        int zx = (10 * 5 + 20);
        int yz = (zx - 5);
        System.out.println(yz);
    }
}

A. 50
65
B. 50
245
C. Some other output
D. Compilation Error or Runtime Error
Topic: Basic Arithmetic Operators 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 is A: 10*5=50 n in next step zx wil assign with 70 and later yz is 70-5 is 65

Posted by Vicky Maduri    2014-06-30 03:36:05


65

Posted by Rathod Ajay    2014-06-30 04:16:30


Ans : A ;  zx value is 70, yz = (zx - 5) returns 65; so the outout is 50 65

Posted by Damu Surya    2014-06-30 04:53:51


© meritcampus 2019

All Rights Reserved.

Open In App