In-Class Practice

Random Numbers

Design and code a program named coinToss.c that

  • prompts the user for the number of coin tosses
  • accepts the number of tosses
  • simulates the requested number of tosses
  • calculates the percentage of head results and the percentage of tail results for all of the tosses

You may assume that the user will enter the input without error.

 // Coin Toss
 // coinToss.c

 #include <stdio.h>

 int main (void)

     return 0;
   Printer Friendly Version of this Page print this page     Top  Go Back to the Top of this Page

  Designed by Chris Szalwinski   Copying From This Site   

Creative Commons License