Good, someone would tell me why the End If statement is not used when we open with Else If ?
If (num < 0) Then
Console.WriteLine("El numero es negativo.")
ElseIf (num = 0) Then
Console.WriteLine("El numero es 0.")
Else
Console.WriteLine("El numero es positivo.")
End If
If (num = 0) Then
Console.Write("Se ingresó el cero.")
Else
If (num > 0) Then
Console.Write("Se ingresó un valor positivo.")
Else
Console.Write("Se ingresó un valor negativo.")
End If
End If
In the first one when I use ElseIf it is not necessary to close it with End If , on the other hand in the second when I use Else and "below" "the If , there if I need to close it with a End if . Could someone explain to me why? Which of the two solutions should you use?
Thank you.