Question: Explain the purpose of using the RunOnce variable in the following function: void DisplayMenu(void) { static int RanOnce = 0; printf(Main Menu n ); printf(1.

Explain the purpose of using the RunOnce variable in the following function:

void

DisplayMenu(void)

{

static

int RanOnce = 0;

printf("Main Menu\

n ");

printf("1. Calculate Average Temperature\

n");

printf("2. Calculate Frequency of Variables\

n");

printf("3. Calculate Mean Temperature\

n");

printf("4. Determine Max and Min Temperature

");

if(RanOnce) printf("5. Reinitialize values ");

printf("E. Exit the program ");

RanOnce = 1;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!