Answer:
void main(){
int noOfHits,atBats;
float hittingPercentage;
printf ("Enter the number of hits and the number of at bats for a batter\\");
scanf("%d%d",&noOfHits,&atBats);
hittingPercentage=(noOfHits/atBats)*100;
if(hittingPercentage>300)
printf("the player is eligible for the All Stars Game\\");
else
printf("the player is not eligible\\");
}
Step-by-step explanation:
Here we are reading values for noOfHits,atBats from the user and calculated hittingPercentage. if hittingPercentage>300 we are displaying corresponding message if it is not >300 again another message which illustrating the elogibility