basic if else code example

Example 1: if else statement vb.net

'If statement
If [condition] Then
	[action]
End If

'else if & else statement
If [condition] Then
	[action]
ElseIf [another condition] Then
	[action]
Else 'if none of the conditions are true then carry out the action
	[action]
End If

Example 2: IF else statement

var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}

Example 3: IF else statement

var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}

Tags:

Cpp Example