C#: Program to convert given inches into equivalent yard,feets and inches

In this C# tutorial we "convert given inches into equivalent yard,feets and inches" . Here we are taking three variables
"y" for yards ,"f" for feets and "i" for inches respectively. Now, lets get started!!

using System;
​class prg
{
 public static void Main(String []args)
 {
        int y,f,i;
        Console.WriteLine("Enter Inches : ");
        i=Convert.ToInt32(Console.ReadLine());
        y=i/432;
        i=i%432;
        f=i/12;
        i=i%12;
      Console.WriteLine("Yard =" + y + "Feet =" + f + "Inches =" + i);
}
}
SHARE

Raunak Hajela

Hi. I’m CEO/Founder of Kodestat. I’m Student, Geek, Web Designer, Developer, Blog Enthusiast and Player. Inspired to make things looks better. I like playing with codes plus I am marvel fan :-P You can check my design portfolio here. For consulation fell free to drop an email at raunakhajela@gmail.com.

  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment