Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ACT_8
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- // GONZALES JOHN MICHAEL
- // BSIT CUBAO 2
- private void generateButton_Click(object sender, EventArgs e)
- {
- int start = int.Parse(startTextBox.Text);
- int end = int.Parse(endTextBox.Text);
- tableListBox.Items.Clear();
- for (int i = start; i <= end; i++)
- {
- for (int j = 1; j <= 10; j++)
- {
- int result = i * j;
- string line = String.Format("{0} x {1} = {2}", i, j, result);
- tableListBox.Items.Add(line);
- }
- }
- }
- private void clearButton_Click(object sender, EventArgs e)
- {
- startTextBox.Clear();
- endTextBox.Clear();
- tableListBox.Items.Clear();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment