I am learning C right now and have a problem understanding something about the behaviour of a program with a static variable. As far as i know, static simply increases the scope of a variable to the file containing it.

```
   #include <stdio.h>
   int sum (int num) {
       static int sum =0;
       sum=sum+num;
       return sum;
   }

   int main() {
       printf("%d ",sum(55));
       printf("%d ",sum(45));
       printf("%d ",sum(50));
       return 0;
   }

```

if i execute this i get `55 100 150` as an output. And that's totally fine and expected.
Then i thought could decraese one line by changing it a little bit like this:

```
int sum (int num) {
       static int sum =0+num;
       return sum;
   }

```

but this returns `55 55 55`
I don't understand why it only returns 55 and doesn't add the other variables, that i am giving in the main to it.