TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kaung Htet Kyaw
NA
66
6.4k
How to solve the wrong result getting 0 value
Feb 4 2020 6:48 AM
Hi everyone,
I want to ask that how to solve that problem. I have wrote the program about Calculating the Kinetic Energy. When I finished the program and calculate, it results Zero value. Whatever I change and checking my code,I always get zero. Please someone fix my problem and I will appreciate any answers of my problem.
private void btnCalculator_Click(object sender, EventArgs e)
{
try
{
decimal m, v, K1,KE;
m = Convert.ToDecimal(txtm1.Text);
v = Convert.ToDecimal(txtv1.Text);
K1 = (1 / 2) * m * (v * v);
KE = K1;
lblKineticEnergy.Text = Convert.ToDecimal(KE) + " J";
}
catch (Exception)
{
MessageBox.Show("Please Enter Numbers Only", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
Reply
Answers (
4
)
String.Compare an example of abstraction or encapsulation?
How to Add multiple values in a single textbox(semi colon)