answersLogoWhite

0


Best Answer

to print the sum of first ten numbers:-

void main()

{int i,sum;

sum=0;

while(i<=10)

sum=sum+i;

i=i+1;

}

printf("The sum is : %d",sum);

}

User Avatar

Wiki User

โˆ™ 2010-03-23 01:29:44
This answer is:
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
User Avatar
Study guides
๐Ÿ““
See all Study Guides
โœ๏ธ
Create a Study Guide

Add your answer:

Earn +20 pts
Q: How to Create a program that will display the sum of all numbers from 1 up to 10?
Write your answer...
Submit
Related questions

What BASIC program can compute and display all prime numbers from 1 to 40?

PRINT 2,3,5,7,11,13,17,19,23,29,31,37


Develop an algorithm to display all prime numbers from 2 to 100 Give both the pseudocode version and the flowchart version Convert your pseudocode into a Java program?

Develop an algorithm to display all prime numbers from 2 to 100. Give both the pseudocode version and the flowchart version. Convert your pseudocode into a Java program.


Write a program that output all perfect numbers less than 1000?

If you wanted to output numbers in PHP to get less than a thousand and display all those numbers you could put it in a while loop like this.


What are set of numbers that create a product?

All numbers can create products.


Write a program in c language to display all odd numbers?

You can't display ALL odd numbers because your program will be running forever, counting towards infinity. A much more useful program would be to display all odd numbers between some numbers x and y: void displayOdds(int x, int y) { // Ensure that x is an odd number if(x % 2 == 0) x++; for(; x &lt;=y; x+=2) printf("%d\n", x); }


How do I wwrite a Program that prints all prime numbers from an array?

How do Iwrite a Program that prints all prime numbers from an array?


Write a C plus plus program that asks the user to enter five numbers?

Write a program that asks the user to enter five numbers.Use a floating point data type to hold the numbers.The program should create a file and save all five numbers to the file.


What is the program to find sum of n natural numbers in c plus plus?

Initialise an unsigned integer to zero. As each number is input, increment the running total accordingly. When all numbers are input, display the total.


Display the sum of all numbers from 1 to 100?

5,050


Are all US aircraft required to display registration numbers?

Yes


How does a 3-D CAD solid model program display the progression of work involved in creating a model?

If you input all of the correct numbers then the program will then analyze it and produce a 3-D graph of the date you've put it. You must keep accurate data over your work period to input into the program.


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


Create a program that will display the sum of all numbers from 1 up to the input number?

int sumNums(int n) { int sum = 0; while(n &gt;= 1) { sum += (n--); } return sum; }


How can you create and personalize Pakistan cricket t shirt to use as facebook display picture?

not at all


How do you write a program to find the sum of n numbers in an array?

In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }


Functions of Min Max and Sum in Microsoft Excel?

Min gets the lowest of a range of values. Max gets the highest value. Sum adds numbers together. So if you had numbers in all the cells from A1 to A20 then: =MIN(A1:A20) will display the lowest value out of all the numbers. =MAX(A1:A20) will display the highest value out of all the numbers. =SUM(A1:A20) will give the total of all the numbers added together.


Does a calculator display the exact values of all rational numbers?

No. For example, 1/3 = 0.333333333...(repeats forever). The calculator can only display finitely many digits.


What tools are needed to create DIY display shelves?

Radial arm saw or Circular saw are the common tools used to create display DIY shelves. All need are small hammer, small pipes for making these shelves. These are found in Homedepot


How can one create a sales incentive program that works?

To create a sales incentive program that works, one must make sure they have all the elements of the program correctly done. This includes appealing to the right customers and using good methods of advertising.


Which numbers create only rectangular arrays?

All integers that are not perfect squares.


What are all the factors of a number?

The whole numbers that can be multiplied together to create the number.


How do you fix the radio display on your vectra 2001 LS cant see all the numbers and letters?

You probably have led's failing,a complete display replacement is the only real solution.


Write a C program to find the sum of all prime numbers?

Since there is an infinite set of prime numbers the answer would be infinity.


Does a calculator display the exact values of all irrational numbers?

No. An irrational number is one that does not repeat or finish, and a calculator cannot display millions of digits like an irrational number would have.


What program would you use to create a birthday card?

it really all depends on what age the person is