GUYZ , I GOT A CODE SAYING :
If Operator = “+” Then
Result = Operand1 + Operand2
ElseIf Operator = “-” Then
Result = Operand1 – Operand2
End If
SO MY QUESTION IZ CAN I SAY :
If Operator = “-” Then
no, but you could make it say
If Operator = "+" Then Result = Operand1 + Operand2 End If 'note how you closed this If tag first If Operator = "-" Then 'and then this one starts a new If tag Result = Operand1 - Operand2 End If
ofcause you can do that but nobody codes like that.
the elseif exist for the reason if the first if is true the elseif will not be validated
when there are alot of if and elseif we use select case
assuming that – and + are the only two variables you could do it like this
If Operator = “+” Then Result = Operand1 + Operand2 Else Result = Operand1 – Operand2 End If