typedef struct complex {
double real, imag;
} complex;
...
complex x, y, z;
...
/* add */
z.real = x.real + y.real;
z.imag = x.imag + y.imag;
/* sub */
z.real = x.real - y.real;
z.imag = x.imag - y.imag;
/* mul */
z.real = x.real*y.real - x.imag*y.imag;
z.imag =x.imag*y.real + x.real*y.imag;
/* div */
double d = y.real*y.real + y.imag*y.imag;
z.real = (x.real*y.real + x.imag*y.imag)/d;
z.imag = (x.imag*y.real - x.real*y.imag)/d;
public static final int getSum(final int n) { int sum = 0; for(int i = 1; i <= n; ++i) { sum += i; } return sum; }
Sum = Sum + first number Sum = Sum + second number Sum = Sum + third number Average = 1/3 x Sum
if (n%2==0) sum=n/2*(n+1); else sum=(n+1)/2*n;
int sum(int list[], int arraySize) { int sum=0; for(int i=0; i<arraySize; ++i ) sum+=list[i]; return(sum); }
import java.util.Scanner;public class Summer{public static void main (String[]args){int sum=0;for(int i=1; i
When the sum of a number plus 3 is squared, it is 11 more than the sum of the number plus 2 when squared.
Their sum is real.
13
The sum of a number plus 3 to the square root of 9 to the sum of 2 would equal -2. This is a math problem.
The absolute value of the sum of two complex numbers is less than or equal to the sum of their absolute values.
2
3
4
2
2
2
4