The answer of a + b. A and b are both variabls which means that you only add the a and b to get your answer. Lets say you had this problem a(7h+13) you would put 7ah+13a because a goes first in the alphabet and since 13 doesn't have a letter it would be 7ah+13a.
2.5
B. the sum of the interests of its members.
1.Start 2. Input a,b,c 3. Sum = a+b+c 4. Average = sum/3 5. Output - Sum,Average 6. Stop
int sum = a + b; PS: a and b are int variables that must have been already declared and initialized.
If b is positive, then reduce each of a and b by subtracting 1, repeatedly until b is zero. If b is negative, repeatedly add 1 to both until b is zero. The final value of a is the result you ask for. If a and b are two integers, their sum is a+b, not a-b.
int mul (int a, int b) { int sum= 0; for (; b>0; --b) sum -= -a; for (; b<0; ++b) sum -= a; return sum; }
The sum of is the total of everything being summed; the sum total. Thus the sum of a, b and c is therefore a + b + c.
The sum of b and 8 would be written b+8 or 8+b(commutative property of addition)
b+11
(3+b)
(b+5)
/*use "c-free" compiler*/ #include <stdio.h> main() { int a,b,c; printf("enter the value of a & b"); scanf("%d%d",&a,&b); c=a+b; printf("sum of the two numbers is a+b- %d",c); getch(); }
Assuming that a and b are two non-negative numbers, then their sum is a + b and the difference is |a - b|.
#include<iostream> int main() { std::cout << "Enter value a: "; double a; std::cin >> a; std::cout << "Enter value b: "; double b; std::cin >> b; double sum {a+b}; std::cout << "a + b + (a + b) * (a + b) = " << sum + sum * sum << std::endl; }
3(a + b) + a = 3a + 3b + a = 4a + 3b
I suppose you wanted to ask: how to do multiplication with repeated addition. int mul (int a, int b) { int sum= 0; int sign= 1; if (b<0) { sign= -1; b= -b;} for (; b; --b) sum = sum + a; return sign*sum; }
You remember that 'sum' means addition so that's b+11