Extremely basic division equation not working in c#

前端 未结 3 1645
我寻月下人不归
我寻月下人不归 2021-01-23 00:36

I can\'t get this to divide into a decimal. It is rounding to value 0.

    private void button24_Click(object sender, EventArgs e)
    {
        double x = 0;         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-23 00:51

    You can do one of the follow:

    double x = 1;
    double y = 1.5;
    
    double ans = x / y;
    

提交回复
热议问题