Computer Science, asked by SwastikaSarkar, 9 months ago

write a program to add two numbers. TAKE two numbers as input

its Java​

plz do it

Answers

Answered by harnathyadav2907
1

Explanation:

Full Code

  1. //import java.util.Scanner;
  2. public class Inputfunctions {
  3. public static void main(String[] args) {
  4. Scanner readme = new Scanner(System. in);
  5. System. out. println("Enter Two Numbers (Press Enter after each):");
  6. //two variables to hold numbers.
  7. double n1, n2, n3;
  8. n1 = readme. nextDouble();

Answered by sougatap57
0

Answer:

import java.util.*;

public class HelloWorld{

    public static void main(String []args){

      int a,b,c;

      Scanner sc=new Scanner(System.in);

      System.out.println("enter the first number");

      a=sc.nextInt();

      System.out.println("enter the second number");

      b=sc.nextInt();

     

      c=a+b;

      System.out.println("sum of these numbers:"+c);

    }

}

Output

enter the first number 5

enter the second number 6

sum of these numbers 11

Similar questions