make a program to add two numbers in java
Answers
Answered by
0
Answer:
i dont know
Explanation:
Answered by
0
Your program:
package com.company;
import java.util.Scanner;
class test
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter first number: ");
double n1 = sc.nextDouble();
System.out.println("Enter second number: ");
double n2 = sc.nextDouble();
long n3 = (long)n1+(long)n2;
System.out.println("The sum of the numbers: "+n3);
}
}
Similar questions