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
Get step-by-step solutions from verified subject matter experts
