Since macros are deployed to a program before actual compilation,
isupper(c = getchar())
will expand to
((c = getchar()) >= 'A' && (c = getchar()) <= 'Z')
which, according to the short circuit rule for && calls getchar twice if it returns >= 'A' first time and assigns c value returned by the second call.
source share