11.4k views
1 vote
C Programming:

Define a character variable letterStart. Read the character from the user, print that letter and the next letter in the alphabet. Sample output assuming the user enters 'a': ab #include int main(void) { /* Your solution goes here */ return 0; }

User Marcellus
by
8.4k points

2 Answers

2 votes
This is how to answer this programming question:

#include <stdio.h>
#include <conio.h>

int main(void)
{
char letterStart;

fflush(stdin);
printf("Input character: ");
scanf("%c", &letterStart);

print("Next Letter: %c", ++letterStart);

getch();
clrscr();
}

User Beder
by
8.3k points
7 votes

Answer:

#include <stdio.h>

int main()

{

char letterStart;

printf("Enter the character: ");

scanf("%c", &letterStart);

printf("Your output is: %c%c", letterStart, letterStart+1);

return 0;

}

Step-by-step explanation:

- Declare the character

- Ask the user to enter the character

- Print the letter and the next letter (Adding 1 to the given letter will give us the next letter)

User Bang
by
8.2k points