CODE
#include<stdio.h>
#include<stdlib.h>
int dice(void);
int rolldices(int count);
int dice(void)
{
int a;
srand(10);
a=rand()%10+1;
return a;
}
int rolldices(int count)
{
int x=0,i,a;
{
for(i=1;i<=a;i++)
x=dice();
}
return x;
}
int main(void)
{
int a,x,continuo;
do
{
printf("how many dice(-1 to exit)");
scanf("%d",&a);
x=rolldices(a);
printf("the sum of dices %d",x);
printf("-1 to exit\n");
scanf("%d",&continuo);
}
while(continuo!=-1);
return 0;
}
here it is my code????I coud not find the output of the functionn.I try to do throw dices which is determined by the user .and rand function generate number randomly and according to genrated number I get the sum of dice numbers and my program have to finish wheen the user enter -1!!!
I try to do that but it could not work.where am I wrong???