Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a statement that calls the recursive function BackwardsAlphabet() with par

ID: 643595 • Letter: W

Question

Write a statement that calls the recursive function BackwardsAlphabet() with parameter startingLetter.

#include <stdio.h>

void BackwardsAlphabet(char currLetter){
if (currLetter == 'a') {
printf("%c ", currLetter);
}
else{
printf("%c ", currLetter);
BackwardsAlphabet(currLetter - 1);
}
return;
}

int main(void) {
char startingLetter = '-';

startingLetter = 'z';

/* Your solution goes here */

return 0;
}

Write a statement that calls the recursive function BackwardsAlphabet() with parameter startingLetter.

Explanation / Answer

The complete code is:

#include <stdio.h>

void BackwardsAlphabet(char currLetter){
if (currLetter == 'a') {
printf("%c ", currLetter);
}
else{
printf("%c ", currLetter);
BackwardsAlphabet(currLetter - 1);
}
return;
}

int main(void) {
char startingLetter = '-';

startingLetter = 'z';
BackwardsAlphabet(startingLetter);


return 0;
}

Output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote