illustrates the use of a nested if statement
/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy
Publisher: Sybex;
ISBN: 0782129110
*/
/*
Example4_3.cs illustrates the use of
a nested if statement
*/
public class Example4_3
{
public static void Main()
{
int reactorTemp = 1500;
string emergencyValve = " ";
if (reactorTemp < 1000)
{
System.Console.WriteLine("Reactor temperature normal");
}
else
{
System.Console.WriteLine("Reactor temperature too high!");
if (emergencyValve == "closed")
{
System.Console.WriteLine("Reactor meltdown in progress!");
}
}
}
}
Related examples in the same category