Question: write in C language Part ) Write a function that takes a lowercase character as parameter and computes its rank in the alphabet. If the
Part ) Write a function that takes a lowercase character as parameter and computes its rank in the alphabet. If the character is not a lowercase letter, the function returns - 1. Note that the function returns a value but doesn't print anything. The printing is done in the main() function. Below are sample outputs. Submit the whole program. From main: Enter a character: e From main: Order in alphabet is: 5 From main: Enter a character: 8 From main: Invalid input! Part b) Redo the previous part so that the function does the printing. In this case, the function doesn't return any value. Below are sample outputs. Submit the whole program. From main: Enter a character: f From function: Order in alphabet is: 6 From main: Enter a character: z From function: Invalid input! For any printf() in main(), add the string "From main" and for any printf() in the function, add the string "From function" like the samples above so we can tell from the output where the printing is being done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
