#include <stdio.h>
#include <math.h>
#include <stdlib.h>


   
 
 
   int main ()
{   
    
        int dice1;
	    int dice2;
      
	int  roll , count,counter ,a ;
	int long doubles [13] ={0};
	float frequency=counter+100000000 ,c;
    float percentage=frequency/100000000, d;

	
		dice1 = rand() %6 + 1;
		dice2 = rand() %6 + 1;
       
		for (int roll = 1; roll <=100000000; roll++)
 	        
       if(roll==2
      
         
         
       if(roll==3)
       
       if(roll==4)
       
       if(roll==5)
       
       if(roll==6)
       
       if(roll==7)
       
       if(roll==8)
       
       if(roll==9)
       
       if(roll==10)
       
       if(roll==11)
       
       if(roll==12)
{   
     
     
     

		
}	
	printf ("Sum of Die           Frequency       Percent\n");
	printf ("______________________________________________\n");
            for(count =2;count<=12;count++)
          printf("%2d.\n",count);  
           printf("%d","%f","%%%f",&a,&c,&d);
	{

	}



system ("pause");
return 0;
}

i need help with this 2 dice rolls random 100000000 times then picks the number 2,3,4,5,,,,,12, and how many times it hit and the percentage it hit oni got it to print the way i wanted it to just lost on the rest

WaltP commented: If your post looks bad, feel free to EDIT it to make it look good -3

Recommended Answers

All 2 Replies

i need 11 if statements and 11 printf statements

One for() loop with one printf() would be much easier.

And if you format your code we all could follow it better.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.