Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

#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

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

List some effect of absenteeism on organisations.

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago