In: Computer Science
thanks for the question, here is the code in Java
===========================================================================
public class SubtractNum {
private static int
subtractTwoNumbers(int firstNum,
int secondNum, int thirdNum)
{
firstNum = firstNum -
secondNum - thirdNum;
return
firstNum;
}
public static void
main(String[] args) {
int
firstNum = 100;
int
secondNum = 25;
int
thirdNum = 45;
int
result = subtractTwoNumbers(firstNum, secondNum, thirdNum);
System.out.println(firstNum + "-"
+ secondNum + "-" + thirdNum + " =
" + result);
if(result==(firstNum-secondNum-thirdNum)){
System.out.println("Test Case Passed");
}else{
System.out.println("Test Case Failed");
}
}
}
===========================================================================