if else example

Example 1: html if else statement example

<div *ngIf="!show">
    <div>show is false</div>
</div>
<div *ngIf="show">
  <div>show is ture</div>
</div>

Example 2: if statement in c

#include <studio.h>
int main()
{
  if (logic goes here)
  {
    CODE
  }
  else if (logic)
  {
    CODE
  }
  else{
    CODE
  }
  return 0
}

Example 3: IF else statement

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

Example 4: javascript how to do if else

if (condition1) {
  //  block of code to be executed if condition1 is true
} else {
  //  block of code to be executed if the condition1 is false
}

Example 5: if then else

if then else

Example 6: c#if

if(number > 10)
        Console.WriteLine("test1");
        else
        if(number < 0)
            Console.WriteLine("test2");

Tags:

Html Example