Well, when I run this program it works fine in the first run of it but from the second run it begins to annoy me (or the user):

Code:
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <process.h>

#define pause getch()
#define clear clrscr()

void main(void) {

	char UserName[25];
	char UserPhone[10];
	char UserChoice = ' ';

	clear;

	printf("\nName: ");
	gets(UserName);

	printf("\nPhone: ");
	gets(UserPhone);

	printf("\nContinue [Y/N] ? : ");
	scanf("%c", &UserChoice);

	if(toupper(UserChoice) == 'Y')
		main();
	
	printf("\nPress any key to exit...");
	pause;
	exit(0);
}

First Run:

Name: Mr. X

Phone: 0000000000

Continue [Y/N] ? : y

Second Run:

Name:
Phone: 0000000000

Continue [Y/N] ? : n

Press any key to exit...

Now, you see what is the thing that annoys? In the second run the entry field for the Name is skipped and we are at the field Phone.


Now before you suggest me anything, kindly, consider this revised version of the above program in which I have used flushall() function to avoid the annoyance:

Code:
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <process.h>

#define pause getch()
#define clear clrscr()

void main(void) {

	char UserName[25];
	char UserPhone[10];
	char UserChoice = ' ';

	clear;

	printf("\nName: ");
	flushall();
	gets(UserName);

	printf("\nPhone: ");
	flushall();
	gets(UserPhone);

	printf("\nContinue [Y/N] ? : ");
	flushall();
	scanf("%c", &UserChoice);

	if(toupper(UserChoice) == 'Y')
		main();
	
	printf("\nPress any key to exit...");
	pause;
	exit(0);
}

Well, I have used the flushall() function just before every gets() and scanf() because otherwise the annoyance would not be guaranted to be gone.

Now, the question is:

Do I have to user flushall() everytime I use a scanf() or gets() or any user input function?