this : printf("%d",a>g=a:g=b); makes no sense. I cant tell if you tying to make a conditional in it which you shouldn't ever do especially for something so simple.
You should read into how printf works becuase either your not understanding what is need which is something like this:
int a = 1;
printf("%d",a);
or you meant to use somthing else but I have never seen a syntax like your doing before here a>g=a:g=b.