Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
Expert Solution & Answer
Book Icon
Chapter 9, Problem 2E

Explanation of Solution

Result when replacing the while statement:

The while statement given the program is “s1[i]==s2[i] && s1[i]!='\0' && s2[i]!='\0'”. This while loop will be continued till the two character strings are equal  “(s1[i]==s2[i]) ” and checks till the either of the string is not reached to the “0” “s1[i]!='\0' && s2[i]!='\0'”.

The while loop gets terminated if both the string is not equal or if any one of the string reaches the end of the string...

Blurred answer
Students have asked these similar questions
i need the answer quickly
Write a function which will swap its arguments if the first argument is greater than its second argument,but will not interchange them if the first argument is smaller than or equal to the second argument. Thefunction should return 1 if a swap was made, and 0 otherwise.(Hint: Make sure to use call by reference.)Write also a short test driver(i.e. a main() invoking your function). C++
PLEASE CODE THIS IN C AND NOT C++. ONLY USE IF/CASE AND USER-DEFINED FUNCTIONS. PLEASE DO NOT USE LOOPS,STRUC, AND POINTERS. PLEASE ONLY DECLARE AND CALL VARIABLES IN THE MAIN FUNCTION, EVERYTHING ELSE IS IN A DIFFERENT USER-DEFINED FUNCTION. PLS CHECK IF IT WORKS TOO.
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