Find the Output
int a=1,b=1,m=10,n=5;
{
System.out.println ((m+n));
System.out.println ((m-n));
}
if ((a==1)&&(b==1))
{
System.out.println ((m×n));
System.out.println ((m%n));
}
Answers
Answered by
12
Answer:
15
5
50
2
Explanation:
M+N = 15
m-n = 5
and the if statement is always true as the value of var a and b is 1
Therefore, Code inside the if statement block will be executed.
and hence M x N = 50,M / N = 2.
Answered by
1
Output:
50
0
Explanation:
The first if statement returns fals so it doesn't gets executed.
Similar questions