Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!