Validating result in a calculator app

Hi, I have a doubt to get validate the result.

Actually I have written script for a calculator. Scenario is. I have added 2 numbers (4 + 6) and got result as 10. But I want to validate that result. How ? Can any body explain please

And what does that have with Appium? Is your script on a mobile application?
If yes, you have to get the id’s of the elements you are entering and the result than compare it with a calculation made in scripting.
It would look something like that:

int firstNumber= driver.findElement(By.id(" here you type the id of the first number field ")).getText();
int secondNumber = driver.findElement(By.id(" here you type the id of the second number field ")).getText();
int resultNumber = driver.findElement(By.id(" here you type the id of the second number field ")).getText();
resultScript = firstNumber + secondNumber;
if (resultScript == resultNumber) {
      System.out.println("The calculation is good and validated");
} else {
      System.out.println("The calculation is wrong and not validated");
}

Anyway, this is not necessary to do because both the calculation will be made by your system so they will be equal…
They will not be equal only in case your function for adding numbers is wrong.