Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class number
- {
- private int _age;
- public int sum;
- public int age {
- set { value = _age; }
- get { return _age; }
- }
- private int _num;
- public int num { set { value = _num; } get { return _num; } }
- public int cal()
- {
- sum = _age +_num;
- return sum;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- int a, b;
- a = Convert.ToInt32(Console.ReadLine());
- b = Convert.ToInt32(Console.ReadLine());
- number kj = new number();
- kj.age=a;
- kj.num=b;
- Console.WriteLine(kj.cal());
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement