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
Get step-by-step solutions from verified subject matter experts
