Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Media the carriers of the message 102

Answered: 1 week ago