Почему не меняется label? - C#
Формулировка задачи:
Не выводится в label
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Ex._5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int count = 0, n, x, sum;
n = Convert.ToInt32(textBox1.Text);
while (n > 0)
{
x = n % 10;
sum = n / 10;
if (x != 0)
{
count++;
}
}
label2.Text = count.ToString();
}
}
}Решение задачи: «Почему не меняется label?»
textual
Листинг программы
while (n > 0)
{
//...
}