> I can't quite understand that, could u pls explain more?!
Perhaps you should read your book on functions, and contemplate what
x = rand();
means in terms of a function (ie rand) returning a result (of type int)
Printable View
> I can't quite understand that, could u pls explain more?!
Perhaps you should read your book on functions, and contemplate what
x = rand();
means in terms of a function (ie rand) returning a result (of type int)
ok I guess this is what you mean:
yea this should work...tnxCode:int func(int x,int y)
{
int c;
printf("How much is the product of %d and %d? \n",x,y);
scanf("%d",&c);
return c;
and my int main body is going to be like this:
Code:int main()
{
int a,b,h,d;
srand(time(NULL));
a= rand() % 10;
b= (rand() % 10);
printf("Hello, this is computer assited instruction for multiplication...\n");
h=func(a,b);
d=a*b;
if(h==d)
correct();
else
wrong();
return 0;
}
now could someone give me a hint about how my program remembers the times of occurrence of a certain number?!
like 3,4,5,5,6,7,7,7
a program that tell me 5 is been occurred 2 times,and 7,three times
If you're only using ten integers (0 - 9), you can create an array with ten elements (0 - 9).
When a random number is chosen, increment that element of the array by one.