Question: i want to give one number from the user like 3, 
and then give 3 number from user

like this : 

```
    int n;
    printf("insert one number");
    scanf("%d", n);

    int a;
    for(int i = 1; i <=n; i++){
          scanf("%d", a);
    }

```

**and without using Array calculate this...
this is very important that using array is ban**

Σa[i]a[j] (i≠j)

input example:

*3
 1 2 3*

calculate this

*1x2 + 1x3 + 2x1 + 2x3 + 3x1 + 3x2* 

and output 22

sorry for my bad english, can anyone help me?

Answer: 
I'm going to attempt to answer this without actually giving you the answer:

Since the first number of your input is the number of values you want to read in, you need to store that separately and use it to create a loop.

Your loop (using your example input) will need to compute:

> 
> (1\*2 + 1\*3) + (2\*1 + 2\*3) + (3\*1 + 3\*2)
> 
> 
> 

Which brings it down to what memo1288 was alluding to: figuring out the math component.
Let's do some math. The original expression, in its complete form, based on the example you gave, is:

f(a, n) = Σa[i]a[j] (i < n, j < n, j ≠ i)

= Σa[i] (i < n) Σa[j] (j < n, j ≠ i)

When we replace n with n+1 we get:

f(a, n+1) = Σa[i] (i < n+1) Σa[j] (j < n + 1, j ≠ i)

= Σa[i] (i < n) Σa[j] (j < n + 1, j ≠ i) + a[n] Σa[j] (j < n + 1, j ≠ n)

= Σa[i] (i < n) Σa[j] (j < n + 1, j ≠ i) + a[n] Σa[j] (j < n)

= Σa[j] (j < n + 1) Σa[i] (i < n, j ≠ i) + a[n] Σa[j] (j < n)

= Σa[j] (j < n) Σa[i] (i < n, j ≠ i) + a[n] Σa[j] (j < n) + a[n] Σa[j] (j < n)

= f(a, n) + 2a[n] Σa[i] (i < n)

In other words, the value of the calculation for n numbers is equal to the value of the calculation for n-1 numbers, plus 2 \* the nth number multiplied by the sum of all the previous numbers.

It should be pretty easy to see how you can do this without using an array. You just need to keep track of the running sum of numbers, and the running value of the calculation.

I'll let you write the actual code, since this is clearly a homework question, but that should be plenty of information to get you started.