Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Convertthe above program to java Program 5: Example Relational operators We have six relational operators in C++: ==, !=, >, =, ,> ==returns true if

Convertthe above program to java

Program 5: Example Relational operators

We have six relational operators in C++: ==, !=, >, =, ,>

==returns true if both the left side and right side are equal

!=returns true if left side is not equal to the right side of operator.

>returns true if left side is greater than right.

returns>

>=returns true if left side is greater than or equal to right side.

=returns>

#include

#include

using namespace std;

int main(){

int num1 = 240;

int num2 =40;

if (num1==num2) {

cout\"num1>

}

else{

cout\"num1>

}

if( num1 != num2 ){

cout\"num1>

}

else{

cout\"num1>

}

if( num1 > num2 ){

cout\"num1>

}

else{

cout\"num1>

}

if( num1 >= num2 ){

cout\"num1>

}

else{

cout\"num1>

}

if( num1

cout\"num1>

}

else{

cout\"num1>

}

if( num1 =>

cout\"num1>

}

else{

cout\"num1>

}

//return 0;

getch();

}

Output:num1 and num2 are not equal

num1 and num2 are not equal

num1 is greater than num2

num1 is greater than or equal to num2

num1 is not less than num2

num1 is greater than num2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Android Graphics

Authors: Wallace Jackson

1st Edition

1430257857, 978-1430257851

More Books

Students also viewed these Programming questions