Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

c# switch expression greater than -statement code example

Example: c# switch case greater than

int mark = 50;
switch (mark)
{
    case int n when n >= 80:
        Console.WriteLine("Grade is A");
        break;

    case int n when n >= 60:
        Console.WriteLine("Grade is B");
        break;

    case int n when n >= 40:
        Console.WriteLine("Grade is C");
        break;

    default:
        Console.WriteLine("Grade is D");
        break;
}

Tags:

Csharp Example

Related

laravel eloquent inverse with code example python add iem tolist code example add element in 5th row in matrix in r language code example check if string has \t python code example transform.rotate vector3 code example col-centered bootstrap 5 code example how to read from a file in shell script code example how to check if a variable is a number in java code example golang array element with , code example express rate limit redis example recursion questions in c code example append into array python code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy