Question: PLEASE EXPLAIN THIS PROBLEM: Let TOUPPER be the following macro: #define TOUPPER(c) ('a'

PLEASE EXPLAIN THIS PROBLEM:

Let TOUPPER be the following macro:

#define TOUPPER(c) ('a'<=(c)&&(c)<='z'?(c)-'a'+'A':(c))

Let s be a string and let i be an int variable. Show the output produced by each of the following program fragments.

(a)

strcpy(s, "abcd"); i = 0; putchar(TOUPPER(s[++i]));

(b)

strcpy(s, "0123"); i = 0; putchar(TOUPPER(s[++i]));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!