Mega Code Archive

 
Categories / C# / Data Types
 

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));     } }