import java.util.Scanner;
public class ADVclass
{
public static void main(String[] args)
{
char function;
double num1,num2;
Scanner input = new Scanner(System.in);
while (true)
{
System.out.println("Enter the First number");
num1=input.nextDouble();
num2=input.nextDouble();
System.out.println("Enter the function");
function = input.next().charAt(0);
if(function == '+')
System.out.println(num1+num2);
else if (function =='-')
System.out.println(num1-num2);
else if(function =='*')
System.out.println(num1*num2);
else if(function =='/')
{
if (num2!=0)
System.out.println(num1/num2);
else
System.out.println("Invalide");
}
}
}
}
i want to add another number to the result generated
example: if i add 1+1=2 i want to add this two to another number and add a clear statement at the end