Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the program comparing_strings.c provided as boilerplate code to you. This program * Asks the user to enter two strings. This code is provided to

Complete the program comparing_strings.c provided as boilerplate code to you. This program

* Asks the user to enter two strings. This code is provided to you in full and does not need to be modified.

* Compares the two strings, to figure out if they are equal or if not, which one of them figures first in a dictionary. This is the part you need to work on.

* The program then prints out the ordering. This code is fully provided to you and does not need to be modified. Read the comments in the provided code to have an idea how to get started.

Please do not use userdefinedfunction

#include  int main(int argc, char **argv) { const int BUF_LEN = 128; char str1[BUF_LEN]; char str2[BUF_LEN]; int i; char c; int comp; /* Get the user to enter two strings */ printf("Please enter two strings, finishing each entry by pressing Enter. "); for (i=0; i 0) { printf("The string \"%s\" figures in a dictionary after the string \"%s\". ", str1, str2); } else { printf("The two strings \"%s\" and \"%s\" are equal. ", str1, str2); } } return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions