#include <stdio.h>
#define abs(x) (x < 0 ? -x : x)
int x;
int doubleGlobalX()
{
x*=2;
return x;
}
int main()
{
scanf("%d",&x);//5
printf("%d\n",abs(doubleGlobalX()));//20
return 0;
}
When the input is 5
the output of this code is 20
. When input is 15
the output is 60
. Don't know why it doubles the global twice.