#include <iostream>

using namespace std;

struct abs_return_type {
  int sign, // sign is +1 or 0 or -1
    val;  // val is > 0 and is the absolute value of a number
};

struct abs_return_type absolute_value(int);

struct abs_return_type absolute_value( int b ) {
  struct abs_return_type v;
  // evaluates to 1 if b is positive, 0 if it is 0, -1 otherwise
  v.sign = ( b > 0 ) ? 1 : ( ( b == 0 ) ? 0 : -1 );
  v.val = (b>0) ? b : -b;

  return v;
}

int main()
{
  int a = -2;
  struct abs_return_type v = absolute_value( a );

  cout << v.sign << endl;
  cout << v.val << endl;

  return 0;
}
