Ask Question
1 June, 19:03

Write afunction BalerAvg which calculate and display the average of aplayer (Baler), call this

function in mainprogram (function). Take input of runs given and ball deliveredfrom the user in

mainfunciton.

The average may becalculated by the formula,

Average = (Total Runs given * 60) / (Total number of ballsdelivered);

+5
Answers (1)
  1. 1 June, 20:11
    0
    C program calculate and display the average of a player

    #include

    void BalerAvg (int runs, int balls) / /Defining function

    {

    double Avg=0.0;

    Avg = (double) (runs * 60) / (balls); //formula is given in question

    printf ("Average is%f", Avg); //printing the average

    }

    int main () / /driver function

    {

    int runs=0, balls=0;

    printf ("Enter runs given by the baler in an over/n"); //taking input from user

    scanf ("%d",&runs);

    printf ("Enter the number of balls dilivered by the baler/n");

    scanf ("%d",&balls);

    BalerAvg (runs, balls); //Calling Function

    return 0;

    }

    Output

    Enter runs given by the baler in an over

    5

    Enter the number of balls dilivered by the baler

    69

    Average is 4.347826

    Function BalerAvg which calculate and display the average of a player (Baler)

    void BalerAvg (int runs, int balls) / /Defining function

    {

    double Avg=0.0;

    Avg = (double) (runs * 60) / (balls); //formula is given in question

    printf ("Average is%f", Avg); //printing the average

    }

    This is the function with the name BalerAvg of return type void having parameters runs and balls of integer type. This function is used to calculate the average of a player.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write afunction BalerAvg which calculate and display the average of aplayer (Baler), call this function in mainprogram (function). Take ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers