#include <stdio.h>
int main()
{
char a, b;
a = getchar();
fflush(stdin);
b = getchar();
printf("........The Result are a: %c b : %c", a, b);
return 0;
}
Hi all see the program. while reading a character for the variable b its giving problems. The fflush is not clearing the input buffer (stdin).
How to solve this.
int main()
{
char a, b;
a = getchar();
fflush(stdin);
b = getchar();
printf("........The Result are a: %c b : %c", a, b);
return 0;
}
Hi all see the program. while reading a character for the variable b its giving problems. The fflush is not clearing the input buffer (stdin).
How to solve this.