write a program to find sum of numbers from 10 to 20
Answers
Answered by
2
Answer:
import java.util.Scanner;
public class KboatSumProdConcat
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.println("Enter 10 integers");
long sum = 0, prod = 1;
for (int i = 0; i < 10; i++) {
int n = in.nextInt();
sum += n;
prod *= n;
}
String s = Long.toString(sum) + Long.toString(prod);
long r = Long.parseLong(s);
System.out.println("Concatenated Number = " + r);
}
}
Explanation:
Answered by
0
10+20=30 in other way its 30-20=10
Similar questions
Computer Science,
2 days ago
Math,
2 days ago
Computer Science,
4 days ago
Chemistry,
8 months ago
Computer Science,
8 months ago