Question: Please help me solve this. #include #include #include//string.h includes strlen() which returns //the index of the null byte of the C string passed in as

Please help me solve this.

#include

#include

#include//string.h includes strlen() which returns

//the index of the null byte of the C string passed in as an argument

#define SZ 31

int main(void)

{

char entered[] = "Programming Logic 101 Course";

char result[SZ] = { 0 };

int i, j;

for ( j = i = strlen(entered); i > -1; i--, j--)

{

if (isdigit(entered[i]))

{

result[j] = 'b';

}

else if (isspace(entered[j]))

{

result[j] = 'W';

}

else if (isupper(entered[j]))

{

result[j] = 'x';

}

else

{

result[j] = 'Q';

}

}

printf("%s ", result);

return 0;

}

The above code outputs: xQQQQQQQQQQWxQQQQWbbbWxQQQQQQ

It should output:lllllUsnnnsllllUsllllllllllU

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 Programming Questions!