Question: Write a function with return type Boolean and name it add. It must take 2 parameters both integers. It adds the two parameters and if

Write a function with return type Boolean and name it add. It must take 2 parameters both integers. It adds the two parameters and if its negative or O returns true otherwise false
public boolean add(int a, int b)
{
int temp =a-b;
if (temp 0)
return true;
return false;
}
public boolean add (int a, int b)
{
int temp =a+b;
if (temp =0)
return true;
return false;
}
public boolean add()
{
int temp = a + b;
if (temp =0)
return true;
return false;
}
Write a function with return type Boolean and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!