Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

String int help!

$
0
0

I want to  be able to write "cm" or "dm"  in the same writeline, but i dont know how to do that.

Example: 

Enter the length : 10 cm

the area is 100 cm2

___________________________________________

This is what i've got..

Console.Write("Enter the length of a square ( Example : 10 cm  ) : ");
                int length = int.Parse(Console.ReadLine());
 
            int Area = length*length;

            Console.WriteLine("The Area is : "+Area);
            Console.Read();


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>