(C PROGRAMMING ONLY) 7. Comparing Characters by CodeChum Admin Most, if not all things have numeric values. That goes for characters too. In order to find out which character has a higher value, we have to compare them with each other and display the value of the higher character. Instructions: In the code editor, you are provided with a main() function that asks the user for 2 characters, passes these characters to a function call of the getHigherValue() function, and then prints out the ASCII value of the higher character. Your task is to implement the getHigherValue function which has the following details: Return type - int Name - getHigherValue Parameters - 2 characters to be compared Description - the ASCII value of the higher character. Hint: Comparing characters in C is just like comparing integers. DO NOT EDIT ANYTHING IN THE MAIN Input 1. First character 2. Second character Output Enter first character: a Enter second character: h Result value = 104
(C
7. Comparing Characters
by CodeChum Admin
Most, if not all things have numeric values. That goes for characters too. In order to find out which character has a higher value, we have to compare them with each other and display the value of the higher character.
Instructions:
In the code editor, you are provided with a main() function that asks the user for 2 characters, passes these characters to a function call of the getHigherValue() function, and then prints out the ASCII value of the higher character.
Your task is to implement the getHigherValue function which has the following details:
Return type - int
Name - getHigherValue
Parameters - 2 characters to be compared
Description - the ASCII value of the higher character.
Hint: Comparing characters in C is just like comparing integers.
DO NOT EDIT ANYTHING IN THE MAIN
Input
1. First character
2. Second character
Output
Enter first character: a
Enter second character: h
Result value = 104
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images