Can anyone expain the if statement syntax


The expression you entered is not valid here.
Please have a if-else block before the switch and assign the value to some variable and then use the variable in the switch expression.

Karthik Byggari

Hi @Gaurav07,
It looks that those are two IF’s nested one into another. So first if is checking if gender is “F” (if not then it’s assigning “Mr”), then it’s entering to the second if and checking if “married” (if yes then it’s assigning “Mrs” if not then “Ms”).