Here\'s a small program:
#include int main() { char str[21], choice[21]; int size; while(1){ printf(\"$ \"); fgets(str, 20, stdin);
Use a 'char' of a specific size char choice [1]
char choice [1]
OR
char c[1]; c = getchar(); if(c[0] == 'y' || c[1] == 'y'){ // DO SOMETHING }