Help with a C# code for class

I don't really see a set of rules to abide by or a related subreddit where this can be posted, so i figured I might as well try my luck here! I am in a beginning programming class that is focusing on console applications using C#. I have been tasked with converting a user entered value into feet and inches, as well as into yards, feet, and inches (which I have completed). My final task is to display the first and last digit of the value entered by the user entered and to label them appropriately.

This is my code so far:

 int[] userNum = new int[1]; Console.WriteLine("Please enter inches to be converted:"); userNum[0] = Convert.ToInt32(Console.ReadLine()); int result = userNum[0] / 12; int result2 = userNum[0] % 12; int result3 = userNum[0] / 36; Console.WriteLine("The result is..." + result + " feet, and " + result2 + " inches."); Console.WriteLine("The result is..." + result3 + " yard(s), " + result + " feet, and " + result2 + " inches."); Console.ReadLine(); 

I have no idea how to take the digits from the user entered value and display them. If this is the correct subreddit for what I am requesting, please help me if you can. If this not the correct subreddit please direct me to where I can receive help.

by Welcome_To_Forever via /r/csharp

Leave a Reply