A static method that returns a Boolean value. : bool : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » bool »

 

A static method that returns a Boolean value.








    
 

using System;

class MainClass{

    public static Boolean TestInput(int val) {
        if (val < 1 || val > 10)
            return false;
        return true;
    }

    public static void Main() {
        Console.WriteLine("TestInput(0) = {0}", TestInput(0));
        Console.WriteLine("TestInput(1) = {0}", TestInput(1));
        Console.WriteLine("TestInput(5) = {0}", TestInput(5));
        Console.WriteLine("TestInput(11) = {0}", TestInput(11));
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» bool