Question: *******THIS SHOULD BE DONE IN C CODE, NOT C++******* 2 Hydroxide (20 Points) Name the project: hydroxide We are interested in determining if a given

 *******THIS SHOULD BE DONE IN C CODE, NOT C++******* 2 Hydroxide

*******THIS SHOULD BE DONE IN C CODE, NOT C++*******

2 Hydroxide (20 Points) Name the project: hydroxide We are interested in determining if a given chemical compound is a hydroxide. A chemical compound is a hydroxide if it ends with OH. For example MgOH is a hydroxide, while NaC1 is not We want to write a program that handles this test for us. Create a function called hydroxide that takes the string entered by the user as an argument. Assume the string can have at most 10 characters. The function should return 1 if the string argument ends in the substring OH and 0, otherwise. The main program should then print whether or not the given compound is a hydroxide. An example of the program is as follows: Enter a chemical compound KOH This is a hydroxide. Another example of the program is given below Enter a chemical compound: H20 This is not a hydroxide

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!