i was trying out this dice problem and i could not figure out how to 
get the percentages of each number to print out. this what i have so 
far and i was wondering if any of u could give me a hint as to what 
to do. thx in advance.

#include <iostream.h>
#include <stdlib.h>
void main ()
{
randomize ();
int c,a,b;
int total[12];
for (int j=2;j<=12;j++)
         {
          total[c]=0;
         }
for (int i=0;i<=10;i++)
 {
 a=random (6)+1;
 b=random (6)+1;
 c=a+b;
 cout<<"Number rolled = "<<c<<endl;

 }
        for (j=2;j=12;j++)
         {
         total[c]=total[c]+1;
         cout<<j<<" "<<total[c]<<endl;
         }
}





>-----------------------------------------~-~>
CHECK THE ARCHIVE BEFORE POSTING!!!! Archive is available at 
http://www.eScribe.com/software/C-Paradise/

>------------------------------------------_->


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/C-Paradise/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to