Answered step by step
Verified Expert Solution
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)
#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
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 {
print (start, 'a');
}
else if (c >= 'A' && c
{
print (start, 'A');
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started