Question: Create a function called XO ( ) that takes a string, checks if it has the same number of x s and o s and

Create a function called XO() that takes a string, checks if it has the same number of xs and os and returns either 1(true) or 0(false). Return 1 if the number of xs and os are the same; otherwise, return 0. When x and o are not in the string, return 1. In main(), read in a string using gets() and pass it to the function. Print whether the xs and os have the same count or not. Output example: Enter a string: aaxxoo X and O have the same count. ------------------------------- Enter a string: aaxxxoo X and O DO NOT have the same count. ------------------------------- Enter a string: aa X and O have the same count. // Both have 0 count

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!