Answers for "how to make else statement which is complete oposit of a if methode c#"

C#
0

how to do else in c#

if (condition)
{
  // block of code to be executed if the condition is True
} 
else 
{
  // block of code to be executed if the condition is False
}
Posted by: Guest on September-30-2020
0

C# how to use if and else

string text = Console.ReadLine();
if(text == "yes")
{
    Console.WriteLine("Correct!");
}
else
{
    Console.WriteLine("Incorrect!");
}
Posted by: Guest on September-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language