0
#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.

abelenky
  • 61,055
  • 22
  • 102
  • 154
  • First, you are comparing `a` to the address of `"Red"`, which will not be equal. You probably want to store a buffer and `strcmp`, and turn up your compiler warnings. – Neil Nov 12 '21 at 03:14

0 Answers0