Feet to Meter
C# is one of the popular programing language used in developing for a wide range application, which includes desktop software, web application and game .in this article we will write about simple c# programme to convert into feet to meter.
To being, we need to understand and learn about the formula for converting feet to meter. One foot is equal 0.3048 meters. So to convert feet to meter , we have to multiply the number of feet by 0.3048.
Here’s the C# program for feet to meter:
Let’s understand the code step by step for feet to meter:
- Firstly we start by importing the system namespace, which have the console class we will use to read user input and write for output to the console.
- We will explain about a class called feet to meter converter.
- We explain the main method, which is entry point for program. This method will be called when the program run.
- We announce two double variables: feet and meters .we will use the feet variable to store the length in feet entered by the user, and the meters variable will be stored to convert length into meters.
- We will convert the length in feet to meter by using the formula we discussed before and store the result in the meters variable
- We take help of the console. writeline method to output the converted length in meters to console, by using the sting interpolation which includes the value of the feet and meters variables in output.
- By using the console. Readline method to keep the console window open for the user, until user press any key
Its done! , we have written a simple c# programme about how to convert feet to meter
You may also check our other Programs:
Write a C# program to sort a string array in ascending order
Write a C# program to find maximum occurring character in a string
Write a C# program to add two numbers using function