#include<stdio.h>
#include<string.h>
int main()
{
char letter;
char answer[10];
char affirmation[10] = "yes";
do
{
printf("Enter a character: \n");
scanf("%c",&letter);
if(letter>=65 && letter<=90)
{
printf("UPPERCASE! \n");
}
else if(letter>=97 && letter<=122)
{
printf("LOWERCASE \n");
}
else
{
printf("Not an Alphabet \n");
}
printf("Wanna try for another Character ? [yes/no] \n");
scanf("%s",&answer);
}
while(strcmp(affirmation,answer) == 0);
return 0;
}
I was trying to make a program which would tell if the character entered is uppercase or lowercase and then ask if the user wants to try again for another character. But it is not reiterating in the desired way.Sometimes it says "terminated with signal 11". Here it is.And sometimes it acts completely different. See here.What should be done in order to get desired results?