Forgive me for the confusing syntax, I am new to coding. My question is simple. In my last statement, >> "else if (digits[15] == 5 (&&) digits[14] == 1 || digits[14] == 2 || digits[14] == 3 || digits[14] == 4 || digits[14] == 5;)"
I am trying to say "if the first digit in the credit card number is 5 and the second number is 1 or 2 or 3 or 4 or 5 then print out Mastercard". I do not understand the syntax and I am almost done with this problem, could somebody please run this code and help me understand where I am wrong with this statement. Thank you.
#include <stdio.h>
#include <cs50.h>
int main(void)
{
...
[EDIT: unreated code removed for Honor Code compliance.]
else if (digits[15] == 5 (&&) digits[14] == 1 || digits[14] == 2 || digits[14] == 3 || digits[14] == 4 || digits[14] == 5;)
{
printf("Mastercard\n");
return 0;
}
}
}