If/Else
If/Else Statement in Computer Programming
age = 18
if age >= 18:
print("You are eligible to vote.")
else:
print("You are not eligible to vote.")int number = 10;
if (number > 0) {
Console.WriteLine("The number is positive.");
} else {
Console.WriteLine("The number is not positive.");
}Last updated
Was this helpful?