Respuesta :

public int add2n( int n )
{
    int total;
    if( n % 2 == 0 )
        total = n--;

    while( n > 0 )
    {
        total += n;
        n -= 2;
   }
   return( total );
}