if oneline condition then no need of curly braces.

 bool flag = true;

if (flag)Console.WriteLine(flag);

string name = "steve"; if (name == "bob") Console.WriteLine("Found Bob"); else if (name == "steve") Console.WriteLine("Found Steve"); else Console.WriteLine("Found Chuck");

Comments