Computer Science, asked by ashwin41566, 7 months ago

Write a java program for subtraction of two number.
[Parameterised Input].


Answers

Answered by nishitathakur3
6

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

Answered by laibaKounain
4

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. }

Similar questions