So I am trying to write a lotto program where the user input is two integers 0-36 or two colors. After that compare them and if the choose to put numbers and it's a match then it should print 36 else if they choose to put colors and matches it should print 2ggr.
Now I get this error comparison between pointer and integer
.
I am new to programming so I would be happy to get some help.
#include <stdio.h>
#include <string.h>
int main()
{
char a[10];
char b[10];
scanf("%s %s", a, b);
if (a >= 0 && a <= 36 && b >= 0 && b <= 36)
{
if (a == b)
{
printf("36ggr");
}
else if (
a == 'Red'
|| a == 'green'
|| a == 'black'
&& b == 'Red'
|| b == 'green'
|| b == 'black'
)
{
if (a == b)
{
printf("2ggr");
}
}
else
{
printf("Inget vinst");
}
}
return 0;
}