Answer to Question #253622 in Java | JSP | JSF for Sara

Question #253622

Find the error and correct it:

• if(x>=3)

System.out.println(“ number is equal to 3 “) ;

System.out.println(“ or number is greater than 3 “) ;

else

System.out.println(“ number is not greater or equal to 3 “) ;


1
Expert's answer
2021-10-20T12:47:29-0400
public class IfElseStatement {


	public static void main(String[] args) {
		// condition x<3
		int x = 2;


		if (x >= 3) {


			System.out.println(" number is equal to 3 ");


			System.out.println(" or number is greater than 3 ");


		} else {


			System.out.println(" number is not greater or equal to 3 ");
		}


	}
}

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS