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.9E
Program Plan Intro

Program Plan:

  • Declare character type variable string1 and string2 to read two strings from the user.
  • 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 determines if first strings are less than, equals to or greater than the second string using strcmp function.

Blurred answer
Students have asked these similar questions
Using the code and the function above
-Convert SES variable to a factor and assign the value labels “low”, ”middle” and “high” to the 3 levels of thevariable. Then -Define the variables complic, comorb, depressi, diabetes as factors. For all these factors, a zero means “no” and a 1 means “yes”. Assign these value labels through the function factor() and check the change using str()
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 (&).
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning