Cls on heads or tails program


Question:

CLS on heads or tails program

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 Preview :

Prepared by a verified Expert
Programming Languages: Cls on heads or tails program
Reference No:- TGS01937381

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)