This is that game called "Guess the magic number". I want to put \f (new page) in my code in order to prevent the next user who will try to find out the magic number from seeing my typed in number. Can i actually do it using /f? I considered that opening a new page will make the typed in magic number "invisible" to the next user. I can't figure out where to put it in order to do the "trick". I have never used \f before.
#include <stdio.h>
int main(void)
{
int magic;
int guess;
int i;
printf("Type in the magic number: ");
scanf_s("%d", &magic);
guess = 0;
for (i = 0; i < 10 && guess != magic; i++)
{
printf("Enter your guess: ");
scanf_s("%d", &guess);
if (guess == magic)
{
printf("RIGHT!");
printf(" %d is the magic number.\n", magic);
}
else
{
printf("... Sorry, you're wrong...");
if (guess > magic)
printf(" Your guess is too high.\n");
else printf(" Your guess is too low.\n");
}
}
printf("You guessed the number after %d attempts. ", i);
return 0;
}