Question: Write a program in C that reads a number m > 0 and then prints the result of m coin tosses using the random number

Write a program in C that reads a number m > 0 and then prints the result of m coin tosses using the random number generator. It should also print the number of heads and tails at the end. You should seed the random number generator using the time. You can use the C functions srand(), rand() and time() from stdlib.h and time.h. Example output: Please enter number of coin tosses: 3 Coin toss 1 resulted in a head Coin toss 2 resulted in a tail Coin toss 3 resulted in a tail Heads rolled: 1 Tails rolled: 2

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!