7. Comparing Characters 1 #include
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
Hello! Please help me find the C language code of this. Thank You!

Transcribed Image Text:7. Comparing Characters
1 #include<stdio.h>
by CodeChum Admin
2
3- int main) I
char a, b;
Most, if not all things have numeric values. That goes for characters too. In order to find out
4
which character has a higher value, we have to compare them with each other and display
printf("Enter first character: ");
a = getchar();
getchar();
the value of the higher character.
7
8
Instructions:
9.
printf("Enter second character: ");
b = getchar();
getchar();
10
1. In the code editor, you are provided with a main() function that asks the user for 2
11
characters, passes these characters to a function call of the getHigherValue() function,
and then prints out the ASCII value of the higher character.
2. Your task is to implement the getHigherValue function which has the following details:
12
13
14
printf("Result value = %d", getHigherValue(a, b));
1. Return type - int
15
2. Name - getHigherValue
16
return 0;
17
3. Parameters - 2 characters to be compared
4. Description - the ASCII value of the higher character.
3. Hint: Comparing characters in C is just like comparing integers.
4. DO NOT EDIT ANYTHING IN THE MAIN
Input
1. First character

Transcribed Image Text:characters, passes these characters to a function call of the getHighervalue() function,
and then prints out the ASCII value of the higher character.
2. Your task is to implement the getHigherValue function which has the following details:
1. Return type - int
main.c
< > + c
1
#include<stdio.h>
2
3. int main() I
char a, b;
2. Name - getHigherValue
4
3. Parameters - 2 characters to be compared
4. Description - the ASCII value of the higher character.
printf("Enter first character: ");
a = getchar();
getchar();
6.
3. Hint: Comparing characters in C is just like comparing integers.
7
4. DO NOT EDIT ANYTHING IN THE MAIN
8
9.
printf("Enter second character: ");
b = getchar();
getchar();
10
Input
11
12
13
1. First character
14
printf("Result value = %d", getHigherValue(a, b));
2. Second character
15
16
return 0;
17
Output
Enter first character: a
Enter second character: h
Result value = 104
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY