Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute C# Sharp Online

using System;


class Program
  {
    static void Main()
    {
        int result1= Test(0);
        int result2= Test(50);
        int result3= Test(-1);
        
        Console.WriteLine(result1);
        Console.WriteLine(result2);
        Console.WriteLine(result3);
    }
    static int Test (int value)
    {
        if (value==0)
        {
            return -1;
        }
        else if (value <=10)
        {
            return 0;
        }
        else if (value <=100)
        {
            return 1;
        }
        else
        {
            return 2;
        }
        
        
  }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.