so my problem is that I need to read integer values from the user, until the character 'o' is entered. I do not know how to differentiate a character from from a number, when reading values from the user.
I wanted to use a do while, it felt pretty natural.
#include <stdio.h>
#include <stdlib.h>
void main()
{
int a;
do
{
scanf("%d", &a);
} while (a != 'o');
}
but of course I can not use %d for the character that I will enter while the program runs.
So the program should read integers from the user, until a specific character ('o' in this case) is entered. right now, after I input a character it will not read my input, the program will just hang there. Thanks a lot!