> scanf("%d",&fg);
Why are you reading a value into fg, when you've already calculated it on the previous line?

> qav = ((q1+q2+q3)/3)*10;
Beware of rounding errors caused by integer division rounding down.
If there is no risk of overflow, it's better to multiply then divide.

> I don't understand what's wrong.
You also need to say specifically how reality differs from expectation.
Just saying "it's wrong" doesn't tell us what your idea of "it's right" is supposed to look like.