Share
Explore BrainMass

CLS on heads or tails program

I also need to fill in the missing part of the code
In MS-DOS, the command to clear the screen is cls; in UNIX, it is clear. Try the command so that you understand its effect. Modify the heads_or_tails program so that the screen is cleared at the beginning of the program. Use the function call system ("cls") or system ("clear") to accomplish this. What happens when the output is redirected? Is the screen still cleared?

#include "heads_or_tails.h"
void report_a_win (int coin)
{
printf("You win, it was a");
if coin
{
printf ("tailn");
}
else
{
printf ("headn");
}
return;
}
void report_a_loss (int coin)
{printf("You lose, is was a");
if (coin)
{printf("tailn");
}
else
{printf("headn);
}
return
}

Solution Summary

Create function call to clear the screen at the beginning of the program.

$2.19