I am not able to get input from the user. Here is the code...
#include <stdio.h>
#include <ctype.h>
int main(){
.
.
.
char x;
printf("\nDo you want to exit (Y/N): ");
scanf("%c", &x);
if (toupper(x) == 'Y')
{
printf("Exiting...");
}
}
scanf function is not working. Program is automatically exiting without any input.