Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C Sharp for Beginners/Making Decisions

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

If Statement: The if statement in c# is so simple like other languages. The syntax for if statement is: if(condition){ // Statements } Here is condition we can check some expression for true or false. For example 5 > 4 is true but 4 > 5 is false. if(5 > 4){ Console.WriteLine("Yes five is still greater than 4"); } Else part: In the else part if if condition we can give statements which will execute if condition is false. if(5 > 4){ Console.WriteLine("Yes five is still greater than four"); } else { Console.WriteLine("Oh No! five is now no longer greater than four"); }