CSharp examples for Language Basics:Hello World
We can create reusable method that multiplies an integer by 12 as follows:
using System;/* w ww . j a va 2 s. c o m*/ class Test { static void Main() { Console.WriteLine (FeetToInches (30)); // 360 Console.WriteLine (FeetToInches (100)); // 1200 } static int FeetToInches (int feet) { int inches = feet * 12; return inches; } }