#include <stdio.h>
#include <strings.h>
int main()
{
char a;
printf("Enter the traffic signal light :");
scanf("%c", &a);
if(a=="Red")
{
printf("STOP!!!");
}
else
{
printf("GO!!!");
}
return 0;
}
//I am in the beginning stage of coding. I am unable to understand the error, kindly please guide me.
您将a
声明为char
并与字符串“RED”进行比较?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.