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 true or false Return if the number of xs and os are the same; otherwise, return When x and o are not in the string, return 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 count
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
