Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   C++ (https://www.askmehelpdesk.com/forumdisplay.php?f=439)
-   -   Write a function c (https://www.askmehelpdesk.com/showthread.php?t=619296)

  • Dec 13, 2011, 07:03 AM
    Anar22
    Write a function c
    Part a:
    write a function named (rollTheDie)
    that does not take any parameter.
    The function should roll a die twice(two times)Each roll will generate a random number between 1
    and 6 inclusive. The function should return 1 if the sum value of the two rolls is 7
    The function should return 0 if the sum value of the two rolls is 11
    If the sum is neither 7 nor 11.
    the function should return 2.

    partb:
    write a main function that calls rollTheDie function and print if the result is 7 or 11 or not 7 or 11
  • Dec 13, 2011, 07:05 AM
    Anar22
    Can any one help me

  • All times are GMT -7. The time now is 08:53 PM.