Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 LABexam
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- public class InputNumbers
- {
- int num1;
- int num2;
- }
- public class Addition : InputNumbers
- {
- int Anum1;
- int Anum2;
- int sum;
- Form1 f = new Form1();
- public void getSum(int x, int y)
- {
- Anum1 = x;
- Anum2 = y;
- }
- public int printSum()
- {
- sum = Anum1 + Anum2;
- return sum;
- }
- }
- public Label lbl_disp
- {
- get
- {
- return label1;
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int x;
- int y;
- x = Convert.ToInt16(textBox1.Text);
- y = Convert.ToInt16(textBox2.Text);
- Addition a = new Addition();
- a.getSum(x, y);
- label1.Text = Convert.ToString(a.printSum());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement