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:
User Avatar
Study guides

Algebra

20 cards

A polynomial of degree zero is a constant term

The grouping method of factoring can still be used when only some of the terms share a common factor A True B False

The sum or difference of p and q is the of the x-term in the trinomial

A number a power of a variable or a product of the two is a monomial while a polynomial is the of monomials

โžก๏ธ
See all cards
3.8
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
1991 Reviews

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
Still have questions?
magnify glass
imp
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


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); }


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; }


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.


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?


Display the sum of all numbers from 1 to 100?

5,050


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.


Write a program for which give number in ascending number?

the following program will display all numbers given in the array in ascending order #include&lt;stdio.h&gt; void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p&lt;=8;p=p+1) { for(i=0;i&lt;=8;i=i+1) { if(numbers[i]&gt;numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i&lt;=9;i=i+1) { printf("%d ",numbers[i]); } }


Are all US aircraft required to display registration numbers?

Yes

People also asked