SHARE
TWEET

Untitled

a guest Jun 24th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class number
  2. {
  3.     private int _age;
  4.  
  5.     public int sum;
  6.  
  7.     public int age {
  8.         set { value = _age; }
  9.         get { return _age; }
  10.     }
  11.     private int _num;
  12.     public int num { set { value = _num; } get { return _num; } }
  13.     public int cal()
  14.     {
  15.         sum = _age +_num;
  16.         return sum;
  17.     }
  18.  
  19. }
  20. class Program
  21. {
  22.     static void Main(string[] args)
  23.     {
  24.         int a, b;
  25.         a = Convert.ToInt32(Console.ReadLine());
  26.         b = Convert.ToInt32(Console.ReadLine());
  27.         number kj = new number();
  28.         kj.age=a;
  29.         kj.num=b;
  30.         Console.WriteLine(kj.cal());
  31.  
  32.         Console.ReadKey();
  33.  
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top