Q3)a) Write a function to simulate coin tossing, the function will use rand function thatgives an output 0 or 1. Then function will return 0 as Head and return 1 as Tail.b) Write a complete program in C to take a number (N) from the user and toss the coinN times using the function defined in part a), and count the number of Heads andnumber of Tails. Finally, print a histogram using ‘*’ for the number of Heads andTails. For example, if the number of Heads is 5 and number of Tails is 10, thefollowing histogram will be printed: (Hint: Use for loops for repetition and if/elsefor selection of Head or Tail).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here