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
(C++ language)
please quickly  thanks !! use Python
(Count the letters in a string) Write a function that counts the number of letters in a string using the following header: def countLetters(s) : Write a test program that prompts the user to enter a string and displays the number of letters in the string. the answer should be in python.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
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