| introductory-examples/control-structures/if-demo.cs - Demonstrations of if. | Lecture 2 - slide 14 : 43 Program 2 |
/* Right, Wrong */
using System;
class IfDemo {
public static void Main(){
int i = 0;
/*
if (i){
Console.WriteLine("i is regarded as true");
}
else {
Console.WriteLine("i is regarded as false");
}
*/
if (i != 0){
Console.WriteLine("i is not 0");
}
else {
Console.WriteLine("i is 0");
}
}
}