Purchase Solution

CLS on heads or tails program

Not what you're looking for?

Ask Custom Question

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
}

Purchase this Solution

Solution Summary

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

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.