answersLogoWhite

0

For example:

c = a + b;

(This calculates the sum of a + b, and assigns the result to variable c.)

If you repeatedly want to add something to an accumulated sum:

b = b + a;

or better:

b += a;

For example:

c = a + b;

(This calculates the sum of a + b, and assigns the result to variable c.)

If you repeatedly want to add something to an accumulated sum:

b = b + a;

or better:

b += a;

For example:

c = a + b;

(This calculates the sum of a + b, and assigns the result to variable c.)

If you repeatedly want to add something to an accumulated sum:

b = b + a;

or better:

b += a;

For example:

c = a + b;

(This calculates the sum of a + b, and assigns the result to variable c.)

If you repeatedly want to add something to an accumulated sum:

b = b + a;

or better:

b += a;

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


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.


How do you find sum of 100 numbers using fortran programme?

The following is for F95 and later (due to the use of intrinsic SUM ): My assumptions: -Your numbers are integers -Your numbers are stored in an array -The numbers you are describing are 0-100 program findSum !I assumed integer, replace this with your data type integer, dimension(100) :: numbers integer :: sumOfNumbers !We populate an array with our numbers !Replace this with your numbers do i=1,(size(numbers)+1) numbers = i end do !We find the sum of those numbers sumOfNumbers = sum(numbers) !We write out the sum to prompt write(*,*) 'Sum is: ', sumOfNumbers end program findSum


How. to. write an. algorthim. to find the. sum of. first. 15 natural. numbers?

Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers


Write a program to find the sum of even numbers from 2 to50?

In Java:sum = 0;for (i = 2; i


Write a java program to find sum of even and odd numbers in given array?

for(int i = 1; i < 100; i+=2) { System.out.println(i); }


Write a C Program to print sum of squares of odd numbers?

#include


Write a C program to find sum of 3 matrices?

matrix


Write a c program to find the sum of numbers between given limits?

int sum (int min, int max) {return (max-min+1)*(max+min)/2;}


How do you write a program in Q basic to print the sum of the even numbers from 1 to 20 in reverse order?

To write a program in QBasic that prints the sum of the even numbers from 1 to 20 in reverse order, you can follow these steps: DIM sum AS INTEGER sum = 0 FOR i = 20 TO 2 STEP -2 sum = sum + i NEXT i PRINT "The sum of even numbers from 1 to 20 is: "; sum This program initializes the sum to zero, iterates from 20 down to 2 in steps of -2 (to capture even numbers), adds each even number to the sum, and finally prints the result.


Java program to find sum on even numbers from 12-45?

sum = 0; for (int i = 12; i


Write c sharp program to find sum of two numbers?

public int findSum(int n1, int n2) { return n1 + n2; }