Question: So, i have to compare two strings, letter by letter, until one of the one of the strings is less than or greater than the

So, i have to compare two strings, letter by letter, until one of the one of the strings is less than or greater than the other.

but im not aloud to use the strcmp function, but i also have to use that compareString that i have above the main. using that can someone show me how to compare the two using a for loop please? i also cannot use "gets". so if someone could show me how to use a for loop to compare my two strings i have created and the function up top, that would be awesome. thanks.

So, i have to compare two strings, letter by letter, until one

#include #include 3 #include 4 int compa rest ring (char #1, char *), int ength); //0: i-j , 1: i j 8 int main(int argc, char argv]) 10 int length str1 [10] "abd". 12 13 14 15 16 17 18 19 20 21 char = char str2 [10] - "abd" Lengthstrcmp(str1, str2); if (length = 0) printf("Strings are the same "); if (length 0) printf("1st string is greater than second ") 23 24 25 26 27

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!