Question: C program 2. Create a library. The library should contain two functions, Hello and World). Calling the Hello) function should print out the string Hello;

 C program 2. Create a library. The library should contain two

C program

2. Create a library. The library should contain two functions, Hello and World). Calling the Hello) function should print out the string "Hello"; calling the World() function should print out the string "World." The library should use a flag (implemented using a static global variable) that keeps track of which string was last printed. A call to the Hello function should print out 'Fello only if World was the last string printed, and vice versa. The flag should be updated at the end of each function call. Each function should return 1 if the string was printed, 0 otherwise. Write a simple program that uses the library and tests for the correct working of the functions

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!