Computer Science, asked by Anzie9320, 1 month ago

Write an algorithm and draw flow chart to find the sum of 10 numbers supplied using the standard input by using do while loop

Answers

Answered by samarthkrv
0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 Scanner sc = new Scanner(System.in);

 int sum = 0 , i = 0;

 System.out.println("Enter all 10 numbers-");

     do{

         int x = sc.nextInt();

         sum = sum + x;

         i++;

     }while(i < 10);

    System.out.println("The sum of all 10 numbers is " + sum);

}

Explanation:

Similar questions