fastest way to calculate the sum of 1 to x

Hi, I'm making methode that adds all the numbers from 0 to the input. So if the input is 5, the methode returns 15 (=1+2+3+4+5). I found 3 ways to do it and was wondering what the most efficient one is. The options are:

Code:

`public int addition(int input)`

{

int result=0

for(int i=1; i<=input; i++)

{

result+=i;

}

return result;

}

Code:

`public int addition(int input)`

{

return (input*input+input)/2;

}

Code:

`public int addition(int input)`

{

return (input*(input++))/2;

}

The question boils down to, how does the '*' operator work?