Untitled

mail@pastecode.io avatar
unknown
plain_text
17 days ago
676 B
2
Indexable
Never
 internal class Program
 {
     int x = 5;
     int y = 9;
     Program(int x, int y)
     {
         this.x = x;
         this.y = y;
     }
     int sub(int x, int y)
     {
         return (x - y);
     }
     Program()
     {

     }

     static void Main(string[] args)
     {
         Program p = new Program();
         Program p1 = new Program(56,34);
         int sum = 0;
         sum += p.x + p.y;
         Console.WriteLine($"{p.x} + {p.y} = {sum}");
         sum = 0;
         sum += p1.x + p1.y;
         Console.WriteLine($"{p1.x} + {p1.y} = {sum}");
         Console.WriteLine($"{p1.x} - {p1.y} = {p1.sub(p1.x,p1.y)}");
     }
 }
Leave a Comment