Question: Using c language Lab 8 (this is to be turmed in) Palindrome is a string that is the same as backwards or forwards otto ababa

 Using c language Lab 8 (this is to be turmed in) Using c language

Lab 8 (this is to be turmed in) Palindrome is a string that is the same as backwards or forwards "otto "ababa noon In this lab we will work with strings (so we will be using character arrays). 1. Write a program that reads two strings strl and str2 from the keyboard 2. Print both strings 3. Write a function computeLength and call this function in main to compute the length of the string strl and str2. 4 if the string strl is of length 1 the program will terminate 5, ifthe string str2 is of length 0 the program will terminate Next A prefix of a string is a nonempty string that is an initial segment Example "moondog" has prefixes of "moo", "m". "moon", "mo", "moond!".... 6. Write a function isPrefix (strl, str2) that retuns 1 if the string str2 is a prefix of strl substring of stri then isPrefix should return a ONE, if not return a ZERO. See class discussion for the definition 7. Call this function with strl and str2 in main and output your result 8. Now write a function is Palindrome(str) that returms a 1 if str is a palindrome and 0 otherwise. To get full credit use is Prefix in your function 9. Call your function isPalindrome(strl) 10. Output the correct conclusion either PALINDROME or NOT PALINDROME You are NOT to use any standard library functions except for IO functions. You will determine the above and output each in a formatted manner Here is a potential list of functions you may want to declare int computeLength(char str): int isReversePrefix(char strl, char *str2); int isPalindrome (char str)

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!