Question: 1. Write a function with the following declaration: int flips (int n) which simulates n flips of a coin and returns the number of heads

1. Write a function with the following declaration:

int flips (int n)

which simulates n flips of a coin and returns the number of heads in those n flips.

Hint: rand()%2 returns either 0 or 1 with equal probability.

(5 pts)

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!