Is my code correct??? I would like to find the percentage like for example:

30pcs of 60pcs is 50%. But how do I code it??? I mean, how to code to get the PERCENTAGE... Is the formula:

(num/total) * 100 ??? Is this correct:

```
for(x=0;x<3;x++)
{
y=total[x];
p[x]=((float)(y/grand))*100;
}
```

I put 'y' variable to have the 'total[x]' value becuase the compiler will say that it is an error. I think it's like declaration syntax error... I forgot... Please help me.... And by the way, this is a TURBO C program...