answersLogoWhite

0

import java.util.Scanner; public class Sum

{

public static void main(String args[])

{

int sum=0;

Scanner s=new Scanner(System.in);

for(int i=0;i<10;i++)

{

System.out.printf("enter a number:");

sum+=s.nextInt();

}//end of for

}//end of main }//end of class

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?


How do you Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


Write a c program which displays digital watch on the screen after taking the hours and minutes from the user?

Write a program which displays digital watch on the screen, after taking the hours and minutes from the user.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


How do you write a pseudocode that accepts five numbers and displays the sum and average of the numbers?

To write pseudocode that accepts five numbers and displays their sum and average, you can follow these steps: Initialize a variable sum to 0. Loop five times to accept input for each number, adding each to sum. After the loop, calculate the average by dividing sum by 5. Display both the sum and the average. Here’s a simple representation: BEGIN sum = 0 FOR i FROM 1 TO 5 DO INPUT number sum = sum + number END FOR average = sum / 5 OUTPUT &quot;Sum: &quot;, sum OUTPUT &quot;Average: &quot;, average END


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


Write a program in Lex to eliminate white space and collect numbers as a token?

write a lex program to delete space from the program


How do you write the pseudo code for an application that accepts a number as input and displays the value that is one more than the number?

input number print number + 1


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


Write a program that accepts as inputs the edges of a graph and then draws the graph using a computer graphics display?

hey i m going to give a program that accepts edges a input and then it draws the graph using a computer graphics display...


How do you write the pseudocode for an application that accepts a number as input and displays the number three times?

input number for loop = 1 to 3 inclusive print number end for


How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")