Thread: rolling a two dice

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1

    rolling a two dice

    The sum of the two value should then be calculated. Since each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12 with 7 being the most frequent sum and 2 and 12 the least frequents sums. There are 36 possible combinations of the two dice. Use an array to tally the numbers of times each possible sum appears. Print the result in tabular format. who can programe this, he/she so genius!seriously..

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Announcements - C Programming
    Announcements - General Programming Boards
    No, seriously, you need to make an attempt at YOUR homework.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Welcome to the forum, amirul m nasir!

    This forum, like most programming forums, won't do your assignment for you. They will help you complete yours, if you'll post your code, and explain what the problem is. Show that you've put some work into it. It's very much up to you to start the program.

    Say you had 13 cups and wrote a number from 0 to 12 on them. And you had a small sack of beans. Every time you rolled the dice, you could put a bean into the cup that matched the sum of the two die, couldn't you? What would you have then, when you finished rolling the dice?

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Adak View Post
    Welcome to the forum, amirul m nasir!

    This forum, like most programming forums, won't do your assignment for you. They will help you complete yours, if you'll post your code, and explain what the problem is. Show that you've put some work into it. It's very much up to you to start the program.

    Say you had 13 cups and wrote a number from 0 to 12 on them. And you had a small sack of beans. Every time you rolled the dice, you could put a bean into the cup that matched the sum of the two die, couldn't you? What would you have then, when you finished rolling the dice?
    12 cups full of beans... and no dinner.

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by CommonTater View Post
    12 cups full of beans... and no dinner.
    No, you'd have 11 bean cups, 2 empty cups, and some of the cups would be overflowing, while others had just a few beans in them... and no dinner.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dice rolling in c
    By ceddsoboss in forum C Programming
    Replies: 3
    Last Post: 11-06-2010, 02:44 PM
  2. Dice Rolling Program help
    By courtesan in forum C Programming
    Replies: 3
    Last Post: 08-17-2005, 03:14 PM
  3. Rolling Dice
    By pianorain in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 03-22-2005, 07:07 AM
  4. rolling dice program
    By sunny2005 in forum C Programming
    Replies: 20
    Last Post: 03-21-2005, 04:45 PM
  5. rolling dice problem
    By egomaster69 in forum C Programming
    Replies: 7
    Last Post: 10-19-2004, 06:14 PM