OK, I am trying to ask the user to enter in a letter y. I am asking if the letter Y or y is entered, then print something. Its not working. Its executing the clause under the else.
I tested this out by typing in Y or y and it keeps on printing out 'print - did not work'. How can I get it to print 'print - it worked' when I type in eitehr Y or y???
Code:
#include<stdio.h>
void main()
{
char strBoolean[2];
scanf("%s", strBoolean);
if(strBoolean == 'Y' || strBoolean == 'y')
{
print("print - it worked");
}
else
{
printf("print - did not work");
}
}