answersLogoWhite

0


Best Answer
Copy

5050.

User Avatar

Wiki User

โˆ™ 2010-11-23 20:54:59
This answer is:
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0
User Avatar

Add your answer:

Earn +5 pts
Q: What is the sum of 0 to 100?
Write your answer...
Submit

Related Questions

Java code to find the sum in all integer?

The following will sum all integers from 1-100. Adjust according to your needs.int sum = 0;for (int i = 1; i


How do you write while andfor loop to get sum of1to100 integer?

int i, sum; /* example using while */ sum = 0; i = 1; while (i <= 100) { sum += i; ++i; } /* example using for */ sum = 0; for (i = 1; i <= 100; ++i) sum += i;


Hoe can you write a programme to claculate 1 plus 2 plus 3..100?

You add the numbers in a loop. Here is an example in Java:int sum = 0;for (int i = 1; i


What is the sum of 75-100 plus 0?

75 - 100 + 0 = -25


What are the sum of the first 100 integers using the for loop and display the result?

public class Test { public static void main(string args[]){ int sum = 0; for(int i = 0; i <= 100; i++){ sum = sum + i; } System.out.println("Sum = " + sum); } }


How do you write a program to add 1-100?

class sum { void main () { int sum = 0; int n = 1; while ( n <= 100 ) { sum = sum + n; n++ ; } System.out.println("Sum is = " + sum ); }}


What are the sum of the first 100 integers using the do while loop and display the result?

public class TestBB { /** * @param args */ public static void main(String[] args) { int sum = 0; int i = 0; do { sum = sum + i; i++; } while (i <= 100); System.out.println("Total of 100 numbers is: " + sum); } }


Write a program to find sum of all integers greater than 100 and less than 200 that are divided by 7?

...int sum = 0;for (int i = 101; i


Write a c program to print sum of the first 100 natural numbers?

#includeint main(){int i,sum=0;for(i=1;i


Write a programme in C language to find the sum and average of a number?

#include #include void main() { int sum=0,avg=0,a[100],i=0,j=0,k=0; printf("enter the number of elements wanna add"); scanf("%d",&n); for(j=0;j<n;j++) { k=j+1; printf("Enter rank %d element element ",k); scanf("%d",&a[j]); } //for sum for (i=0;i<100;i++) { sum=a[i]+sum; } printf("sum of nos %d",sum); for (i=0;i<100;i++) { avg=sum/n; } printf("avg of nos",avg); getch(); } //you can change avg from int to float to get in decimals.


Write a shell program that Adds the integers 1 to 100 and dislay a message?

SUM = 0: FOR N = 1 to 100: SUM = SUM + N: Next N: PRINT CHR$(11); "Sum ="; SUM: END


Write a java program to calculate the sum of even numbers between 1 to 100?

// finds this sum in range (1, 100] int sum = 0; for(int i = 2; i < 101; i+=2) { System.out.println("Adding : " + i); sum += i; } System.out.println("Sum : " + sum);


What is the sum of the whole numbers from 5 up to 100?

its 5035the summarian notation tells you that(sum of all #from 0 to a number'N'(sum of all #from 0 to N) = (n)+(n-1)+(n-2)+(n-3)+...+(2) +(1) or(sum of all #from 0 to N) = (1)+ (2) + (3) + (4)+...+(n-1)+(n)the two different sums are aligned by columns. now add the two colunms accordingly and you'll get2x(sum of all #from 0 to N)=(n+1)+(n+1)+...+(n+1) (n+1)is added n timesso2x(sum of all #from 0 to N) =n(n+1)(sum of all #from 0 to N) =n(n+1)/2so (sum of 5 to 100) = (sum of 0 to 100)- (sum of 0 to 5)=100(101)/2 - 5(6)/2 = 5050 - 15 = 5035


Why there is a need to use array?

An array is very useful to easily handle a large set of data, or a data set that has a variable size. Here is an example: To add 100 numbers, without an array, you would have to store data to 100 different variables, and then: sum = 0; sum += item001; sum += item002; sum += item003; sum += item004; ... sum += item100; ... a total of 100 lines. To add 1000 items, you need 1000 lines. If you don't know the number of items in advance, it is even worse, because you need to execute every single line conditionally. With an array, the above example gets much more compact: sum = 0; for (i = 0; i < 100; i++) sum += items[i];An array is very useful to easily handle a large set of data, or a data set that has a variable size. Here is an example: To add 100 numbers, without an array, you would have to store data to 100 different variables, and then: sum = 0; sum += item001; sum += item002; sum += item003; sum += item004; ... sum += item100; ... a total of 100 lines. To add 1000 items, you need 1000 lines. If you don't know the number of items in advance, it is even worse, because you need to execute every single line conditionally. With an array, the above example gets much more compact: sum = 0; for (i = 0; i < 100; i++) sum += items[i];An array is very useful to easily handle a large set of data, or a data set that has a variable size. Here is an example: To add 100 numbers, without an array, you would have to store data to 100 different variables, and then: sum = 0; sum += item001; sum += item002; sum += item003; sum += item004; ... sum += item100; ... a total of 100 lines. To add 1000 items, you need 1000 lines. If you don't know the number of items in advance, it is even worse, because you need to execute every single line conditionally. With an array, the above example gets much more compact: sum = 0; for (i = 0; i < 100; i++) sum += items[i];An array is very useful to easily handle a large set of data, or a data set that has a variable size. Here is an example: To add 100 numbers, without an array, you would have to store data to 100 different variables, and then: sum = 0; sum += item001; sum += item002; sum += item003; sum += item004; ... sum += item100; ... a total of 100 lines. To add 1000 items, you need 1000 lines. If you don't know the number of items in advance, it is even worse, because you need to execute every single line conditionally. With an array, the above example gets much more compact: sum = 0; for (i = 0; i < 100; i++) sum += items[i];


How do you write an algoritm that calculates sum of all even numbers ranging from 0-100?

100


Write a C program to print the sum of all even numbers within 100?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int i,sum=0; clrscr(); for(i=2;i&lt;=100;i+2) { sum=sum+i; } printf("sum is %d",sum); getch(); }


What is c program to calculate sum of all even numbers between 1 and 100?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { clrscr(); int i,sum=0; for(i=2;i&lt;=100;i=i+2) { sum=sum+i; } printf("sum of even no.%d",sum); getch(); }


Java program to find the number of and sum of all integers greater than 100 and less than 200 that aredivisible by 7?

public static void main(String[] args) { int count = 0; int sum = 0; for(int i = 100; i < 200; i++) { if(i%7 == 0){ System.out.println(i); count++; sum = sum + i; } } System.out.println("Number of values divisble by 7 is: " + count); System.out.println("Sum of the values divisible by 7 is: " + sum); }


To write a program that calculates and prints the sum of all even numbers between 0 and 100 in c plus plus?

#include using std::cout;using std::endl;int main(){int sum = 0;cout


In c program how to print addition from 1-100 numbers?

#include using std::cout;using std::endl;int main(){const int numToAdd = 100;int sum = 0;for (int i = 1; i


How do you write a C program to display all the odd numbers from 2 to 100 and their sum?

#include&lt;stdio.h&gt;int main () { int sum = 0; for (int odd=3; odd&lt;100; odd+=2) { printf ("%d\n", odd); sum += odd; } printf ("\nSum = %d\n", sum); return 0; }


Write a java program to generate sum of odd numbers from 1 to n?

Increment your counter two at a time. Example, for n = 100: n = 100; sum = 0; for (int i = 1; i &lt;= n; i+=2) sum += i; Another option (less efficient) is to loop through ALL integers, and check whether the number is odd: n = 100; sum = 0; for (int i = 1; i &lt;= n; i++) { if (i % 2 == 1) sum += i; } Or: if (min%2==0) min= min+1; if (max%2==0) max= max-1; sum = ((max-min)/2 + 1) * (min+max) / 2;


Program to find the sum of first hundred natural numbers?

#include #define NUM 100 //since prog is to be written for adding 100 naturalint main(){int i,sum=0;for(i=1;i


Write a unix program to find the sum of n numbers?

If the numbers are consecutive, use a for loop, and just add the counter variable. The following example (Java language) will add the numbers 1, 2, ... 100:int sum = 0;for (int i = 1; i


How do you write a program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7?

int num = 0; int sum = 0; // 105 is the first integer greater than 100 which is evenly divisible by 7 for(int i = 104; i &lt; 200; i+=7) {++num;sum += i; }