Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I get rid of the unnecessary space? (Code below) #include char getStartingChar (char c) { if (c >= 'a' && c { return

How do I get rid of the unnecessary space? (Code below) image text in transcribed
#include
char getStartingChar (char c)
{
if (c >= 'a' && c
{
return 'a' + (26 + (c - 'a') - 4) % 26;
}
else if (c >= 'A' && c
{
return 'A' + (26 + (c - 'A') - 4) % 26;
}
return ' ';
}
void printARow (int row, char c, char initial)
{
for (int i = 0; i
{
printf (" ");
}
for (int i = 0; i
{
printf ("%c", initial + (c + i - initial) % 26);
}
for (int i = row; i >= 0; --i)
{
printf ("%c", initial + (c + i - initial) % 26);
}
printf (" ");
}
void print (char start, char initial)
{
for (int i = 0; i
{
printARow (i, start, initial);
}
}
int main ()
{
char c;
//printf ("Enter a char : ");
scanf ("%c", &c);
char start = getStartingChar (c);
if (c >= 'a' && c
{
print (start, 'a');
}
else if (c >= 'A' && c
{
print (start, 'A');
}
return 0;
}
Submit for grading Latest submission-4:19 PM on 02/23/18 Only show failing tests 1: Compare output Output is nearly correct; but whitespace differs. See yellow highlights below Input E ABA Your outputABCBA 1ABCDCBA ABCDEDCBA ABA Expected output ABCBA ABCDCBA ABCDEDCBA Special character legend 2: Compare output Output is nearly correct; but whitespace differs. See yellow highlights below Inpute

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

In Exercises 1558, find each product. (x + 1)(x 2 - x + 1)

Answered: 1 week ago

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago