i didn't really understand the help i got from shyan since i am 
barely learning the c++ languange. all i need is to know how to 
count and total up thwe values for each number: for instance if a 6 
is rolled it will count 1 for 6 and show me the percentage of 
getting six after about 10 rolls or something. plz help

#include <iostream.h>
#include <stdlib.h>
void main ()
{
randomize ();
unsigned int c,a,b;
unsigned int total[12];
int max=13;
for (int i=1;i<=10;i++)
 {
 a=rand() % 6 + 1;
 b=rand() % 6 + 1;
 c=a+b;
 cout<<"Number rolled = "<<c<<endl;
 ++total[c];
 }
        for (int j=2;j<=12;j++)
         {
         total[max]=0;
         total[max]=total[c];
         cout<<j<<" "<<total[max]<<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