Write a java program for subtraction of two number.
[Parameterised Input].
Answers
Answer:
import java.util.Scanner;
class Substract
{
public static void main(String args[])
{
int p, q, r;
System.out.println("Enter two integers to calculate their substraction: ");
Scanner sc = new Scanner(System.in); //System.in An InputStream which is typically connected to keyboard input of console programs.
p = sc.nextInt(); //scan data for input of integer value
q = sc.nextInt();
r = p - q;
System.out.println("substraction of entered integers = "+r);
}
}
MARK ME AS BRAINLIEST PLEASE
Answer:
1. import java.util.Scanner;
2. class Substract
3. {
4. public static void main(String args[])
5. {
6. int p, q, r;
7. System.out.println("Enter two integers to 8. 8. calculate their substraction: ");
9. Scanner sc = new Scanner(System.in); //10. System.in An InputStream which is typically 11. connected to keyboard input of console programs.
12. p = sc.nextInt(); //scan data for input of integer value
13. q = sc.nextInt();
14. r = p - q;
15. System.out.println("substraction of entered integers = "+r);
16. }