Computer Science, asked by ajitprasher0, 4 days ago

write a program to find sum of numbers from 10 to 20

Answers

Answered by Shubhampro112
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 joinonthelinkplz
0

10+20=30 in other way its 30-20=10

Similar questions