answersLogoWhite

0


Best Answer

#include<stdio.h>

void main()

{

int num, sum=0, i;

printf("Enter ten numbers: \n");

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

{

scanf("%d",&num);

sum += num;

}

printf("\n The sum of the numbers is %d",sum);

getchar();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

double[] numsToSum; // the numbers you want to find the sum of

double sum = 0.0;

for(int i = 0; i < numsToSum.length; ++i) {

sum += numsToSum[i];

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that read 10 numbers from the user and display their sum?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


How do you write a program in java to read ten numbers and print sum of ten integers?

Add the numbers into one variable as you read them in. But if you prefer, you can read the numbers into an array and then use a loop to add the numbers together.


Write a program that will accept two numbers and find their sum anddifferences. If the sum is more than the difference, display the sum otherwisedisplay the difference. Pascal programming?

program SumAndDifference; var num1, num2, sum, difference: integer; begin write('Enter first number: '); read(num1); write('Enter second number: '); read(num2); sum := num1 + num2; difference := num1 - num2; if sum &gt; difference then written('The sum is greater: ', sum) else written('The difference is greater: ', difference); end. This program will prompt the user to enter two numbers, calculate their sum and difference, and then compare the two values. If the sum is greater than the difference, it will display the sum; otherwise, it will display the difference.


Write a program that read and display double number?

class simple { public static void main(String[] args){System.out.println(new java.util.Scanner(System.in).nextDouble());} }


How do you write a C plus plus program to read two numbers and display the larger value?

#include&lt;iostream&gt; int main (void) { int a, b; std::cout &lt;&lt; "Enter two whole numbers:"; std::cin &gt;&gt; a &gt;&gt; b; std::cout &lt;&lt; "The largest of " &lt;&lt; a &lt;&lt; " and " &lt;&lt; b &lt;&lt; " is &lt;&lt; (a&gt;b?a:b) &lt;&lt; std::endl; }


How do you write a program which reads a list of ten numbers and print the list in reserve order in c program?

The simplest way is probably to read the numbers into an array and then prints each element of the array starting at the last one and moving backwards.


Write a program to calculate the sum of two numbers in unix?

$vi sum.sh echo "enter the 1st no." read num1 echo "enter the 2nd no." read num2 sum= 'expr $num1 + $num2' echo "sum of the numbers is $sum"


HOW TO SOLVE 'C' problem?

1. write a 'c' program to read 4(four)numbers from a file 'BANK' and calculate the average of the numbers.Now print the calculated average in another output file 'AVERAGE' 2. write a 'c' program that finds the sum and average of inputted five integer numbers of the array using dynamic memory allocation function malloc(). 3. write a 'c' program to create simple elements 1,2,3,4 in the link list of 4(four)nodes and display the list's elements. 4. write a 'c' program to convert the expression (A+B)/(C+D) into postfix expression into stack.and then evaluate it for A=10,B=20,C=15,D=5 and display the stack status after each operation. 5. write a 'c' programto create a linked list implemented on an array containing the following numbers:1,2,3,3,3,4,4,9 and pack it to remove the duplicate numbers.so that only the following data are contained by the nodes:1,2,3,4,9


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


How do you use a decimal point to read and write very small numbers?

It separates the numbers


Write a program to read your name and reverse it using arrays?

abdulrahman


Which period is not mentioned when you read or write numbers?

the decimal point