Q: What is the sum 1 to 100?

Write your answer...

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

101

The sum of the integers from 1 to 100 inclusive is 5,050.

n*(n+1)=sum 100*(100+1)=10100

The sum of the numbers from 1 through 100 is 5,050.

1+100=101

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

Without just going and doing the addition, you can use this formula:Sum of 1 to N is: (N+1)*N/2. So take sum of [1 to 100], then subtract off the sum of [1 to 20], and you'll have left the sum [21 to 100].Sum [1-100] = (100+1)*100/2 = 5050. Sum[1-20] = (20+1)*20/2 = 210.So 5050 - 210 = 4840

101

The sum is 1,060

The sum of the whole numbers from 1 to 100 inclusive is 5,050.

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;

The sum of the first 100 counting numbers (1-100) is 5,001.

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

The sum of these composite numbers, including 100, is 3989.The sum of all numbers between 1 and 100 is 5,050. From this we need to subtract the sum of 1 plus all the prime numbers below 100. The sum of the primes is 1,060. Subtracting (1 + 1060) or 1,061 from 5,050 yields 3,989.

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

The sum of the all prime numbers from 1 to 100 is 1,161

It is 100*(100+1)/2 = 50500.

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

The sum of all the odd numbers from 1 through 100 is 10,000

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

-99

101

The sum of the numbers 1 to 100 is 5050.

The sum of the even numbers is (26 + 28 + ... + 100); The sum of the odd numbers is (25 + 27 + ... + 99) Their difference is: (26 + 28 + ... + 100) - (25 + 27 + ... + 99) = (26 - 25) + (28 - 27) + ... + (100 - 99) = 1 + 1 + ... + 1 There are (100 - 26) ÷ 2 + 1 = 38 terms above which are all 1; their sum is 38 x 1 = 38. So the difference of the sum of all even numbers and all odd numbers 25-100 is 38.