如何在c#中进行算术运算 [英] How to Do arithmetic operation in c#

查看:73
本文介绍了如何在c#中进行算术运算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用以下值执行算术运算。



结果将显示在标签中。



有一个固定值为1000.



项目中有一个textBox1。

1000 * textBox1 * 60 =结果



此结果必须显示在label1中。



如何操作。



提前致谢。

How to perform arithmetic operation with following value.

And the result to be displayed in a label.

There is a Fixed value that is 1000.

There is a textBox1 in project.
1000*textBox1*60=Result

This result must be displayed in label1.

How to do it.

Thanks in advance.

推荐答案

int Result=1000*Convert.ToInt32(textBox1.text)*60;

Label1.Text=Result.ToString();


对于基本的关节运动,请浏览C#运算符列表 - < a href =http://msdn.microsoft.com/en-us/library/6a71f45d.aspx> C#运营商 [ ^ ]。

对于更复杂的calucations,请尝试他们的 Math 图书馆 [ ^ ]。
For a basic arthimetic operation, go through the C# operators list - C# Operators[^].
For more complex calucations, try their Math library[^].


这篇关于如何在c#中进行算术运算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆