C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 8, Problem 8.10E
Program Plan Intro

Program Plan:

  • Declare character type variable string1 and string2 to read two strings from the user.
  • Declare variable n of type int to store the number of characters to be compared.
  • Use function strcmp to compare the two string.
  • Declare integer type variable result to store the result of the comparison of two string.
  • Display the comparison result using printf() function.

Program Description: 

The program reads two strings and compares their n characters using strcmp function. Then determines if the first string is less than, equal to or greater than the second string.

Blurred answer
Students have asked these similar questions
State whether each of the following is true or false. If false, explain why h) All arguments following the format control string in a printf function must be preceded by an ampersand (&).
Using the code and the function above
Please write out the code for this function using R.
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr