malgaff
0
Q:

if else

if (condition)
{
     //Block of statements here
     //These statements will only execute if the condition is true
}
 else {
	//Write the else condition
}
5
if (condition1) {
  //  block of code to be executed if condition1 is true
} else if (condition2) {
  //  block of code to be executed if the condition1 is false and condition2 is true
} else {
  //  block of code to be executed if the condition1 is false and condition2 is false
}
37
if( name = 'george washington'):
	print("You have the same name as the first president of the United States")
    // python 
else:
	print("You do not have the same name as George Washington")
4
var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}
27

if (hour < 18) {

    greeting = "Good day";

 }
else {

    greeting = "Good evening";

 }
 
5
if (5 < 10) {
	console.log("5 is less than 10");
} else {
	console.log("5 is now bigger than 10")
}
6

if (condition) {

  //  block of code to be executed if the condition is true

 }

 
5

if (hour < 18) {

    greeting = "Good day";

 } 
4

New to Communities?

Join the community