AalborgHTX

Gange uden at bruge gange

Jan 27th, 2021
626
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApp18
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void btnGangeToTal_Click(object sender, EventArgs e)
  21.         {
  22.             int tal1 = int.Parse(txtTal1.Text);
  23.             int tal2 = int.Parse(txtTal2.Text);
  24.  
  25.             int sum = 0;
  26.  
  27.             for (int i = 1; i <= tal1; i++)
  28.             {
  29.                 sum = sum + tal2;
  30.             }
  31.  
  32.             lblResultat.Text = sum.ToString();
  33.         }
  34.     }
  35. }
  36.  
RAW Paste Data