My if statement runs through as if the conditions have been met even when they haven\'t. I have tried moving bits of code about and even rewriting the if statement differently b
This is a bit of a side note to your question, but in this context, you may want to consider converting the answer to lowercase (or uppercase) before comparing it.
That way, you can just use if (tolower(bob) == "no")
Here's an example of how to do use the tolower
function
http://www.cplusplus.com/reference/cctype/tolower/
/* tolower example */
#include
#include
int main ()
{
int i=0;
char str[]="Test String.\n";
char c;
while (str[i])
{
c=str[i];
putchar (tolower(c));
i++;
}
return 0;
}