what’s actual use of fflush(stdin) in c language? and is it good to use? [duplicate]

I am newbie in programming. I’ve found a program in which what’s use of fflush (stdin); that’s I don’t know and that’s program seems like:

include<stdio.h>
include<conio.h>
int main()
{
char another;
int num;
do
{
printf (“Enter a number ”);
scanf (“%d”, &num);
printf (“square of %d is %dn”, num, num * num);
printf (“Want to enter another number y/n ”);
fflush (stdin);
scanf (“%c”, &another);} while (another == ’y’);
return 0;
}

Source: Windows Questions

LEAVE A COMMENT