Today I am going to explain how to use nested If-Else statements in TypeScript. Using nested If-Else statements I explain how to find the grade of any student by entering his or her marks in TypeScript. The syntax of a nested If-Else is:

If(Condition)

{

//If condition is true then write the statement here

}

Else //if condition is false then cursor go to else part

{

If(Condition) //again here check the condition under the else part

{

//If condition is true then write statement here

}

Else //if condition is false then cursor go to else part

{

If(Condition) //again here check the condition under the else part

{

//If condition is true then write statement here

}

Else

{

}

}

}

Now to see how the nested If-Else is used let's use the following.

Step 1

Open Visual Studio 2012 and click on "File" -> "New" -> "Project...".

Step 2

A window is shown, in this select HTML Application for TypeScript under Visual C# and give the name of your application and then click ok.