Hi guys,
I'm having trouble with this particular code
#include <stdio.h>
int main()
{
char aChar;
printf("Please enter a character: ");
scanf("%c",&aChar);
while (aChar!='x')
{
printf("The Letter is %c\n", aChar);
printf("Please Enter another character: ");
scanf("%c", &aChar);
}
return 0;
}
The output is:
Please enter a character: q
The letter is q
Please enter another character: The Letter is
i've got a feeling that when i enter a character, '\n' gets included, is there a way to remove it?