1
visibility
int m=3,n=5,p=4;
if(m==n && n!=p)
{
    System.out.println(m*n);
    System.out.println(n%p);
}
if((m!=n) || (n==p))
{
    System.out.println(m+n);
    System.out.println(m-n);
}

 

  • 8
    -2

  • 15
    20

  • Both If Condition Is False, So No Output

  • none

The first if condition — if(m==n && n!=p), tests false as m is not equal to n. The second if condition — if((m!=n) || (n==p)) tests true so the statements inside its code block are executed printing 8 and -2 to the console.