Question can't enter a decimal number?

CompDummy

Member
Joined
Dec 5, 2020
Messages
5
Programming Experience
Beginner
Hello, I am creating a simple program to calculate the area of a triangle.

But the problem is, I can't enter a decimal number and the result is not a decimal number either. How should I solve this?
 
It sounds like you are using int or long as your data type. Try using double, float, or decimal as your data type.

Out of curiosity, what book or tutorial are you using to learn C#? This is something that should have been covered relatively early.
 
Show your code and put your code in code tags when posting.

Specifically the code relative to your issue and we can take a goosy gander for you.
 

Latest posts

Back
Top Bottom