68 231
Assignments Done
99%
Successfully Done
In November 2018

Answer to Question #3564 in Java | JSP | JSF for Y mukundareddy

Question #3564
(2) Write a program to perform all relational operators on the following variables a=20, b=10?
Expert's answer
public class Main {




public static void main(String[] args) {

int a = 10, b = 5;




System.out.print("a > b ? ");

if(a > b)

System.out.println("yes");

else

System.out.println("no");

System.out.print("a >= b ? ");

if(a >= b)

System.out.println("yes");

else

System.out.println("no");

System.out.print("a < b ? ");

if(a < b)

System.out.println("yes");

else

System.out.println("no");

System.out.print("a <= b ? ");

if(a <= b)

System.out.println("yes");

else

System.out.println("no");

System.out.print("a == b ? ");

if(a == b)

System.out.println("yes");

else

System.out.println("no");

System.out.print("a != b ? ");

if(a != b)

System.out.println("yes");

else

System.out.println("no");

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions