Hi ALL,
Here I wrote a program for Solving Subtraction Issue in Maths Using java.
/**
*
* @author Balamurgan
M
*/
import java.util.Scanner;
public class MathExample {
public static void
main(String arg[]){
System.out.println("Enter the I J value ");
Scanner in=new
Scanner(System.in);
int
i=in.nextInt();
int
j=in.nextInt();
if(i>j){
System.out.println(" Please Solve simple subtraction issue ");
System.out.println(i+"-"+j+"= ?");
int
uans=in.nextInt();
int ans=i-j;
if(ans==uans)
System.out.println(" Answer is corrct" +ans);
else
System.out.println(" Answer is Incorrect :-(");
}else
System.out.println(" Given value is incorrct");
}
}
No comments:
Post a Comment