This method converts inches to centimeter. 1 = 2.54 cm.
Now i’m using in method void type, but can it be done with double type?
can someone show me this code in double type.
namespace csharpnoobie
{
class Program
{
static void Main(string[] args)
{
Console.Write("give number in inches : ");
int calculating = int.Parse(Console.ReadLine());
inches(calculating);
Console.ReadKey();
}
private static void inches(int calculating)
{
Console.WriteLine(calculating + " inches = " + 2.54 * calculating + " cm");
return;
}
}
}
Here you are: