using System;
//complile: csc datatype_long_1.cs
public class predef_long
{
public predef_long() { Console.WriteLine("Constructor activated");}
~predef_long() { Console.WriteLine("Destructor activated");}
public long find_inches(long ln)
{
int inches = 12;
int feet = 5280;
long result = ln * feet * inches ;
return result;
}
}
//test class starts
class test
{
public static void Main()
{
//long inches;
//long miles;
// miles = 93000000; // 93,000,000 miles to the sun
// 5,280 feet in a mile, 12 inches in a foot
//inches = miles * 5280 * 12;
Console.Write("Enter Mile : > ");
string str = Console.ReadLine();
long strln = Int64.Parse(str);
predef_long fl = new predef_long();
Console.WriteLine("Distance : " + str + " Miles = " + fl.find_inches(strln) + "Inches");
}
}
|