using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication6
{
class Program
{
public static void Main(string[] args)
{
Add obj1 = new Add();
obj1.StoreData(5, 6);
int Sum = obj1.GetSum();
Console.WriteLine(Sum);
Console.ReadKey();
}
}
class Add
{
public int a, b;
public void StoreData(int x, int y)
{
a = x;
b = y;
}
public int GetSum()
{
return (a + b);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication6
{
class Program
{
public static void Main(string[] args)
{
Add obj1 = new Add();
obj1.StoreData(5, 6);
int Sum = obj1.GetSum();
Console.WriteLine(Sum);
Console.ReadKey();
}
}
class Add
{
public int a, b;
public void StoreData(int x, int y)
{
a = x;
b = y;
}
public int GetSum()
{
return (a + b);
}
}
}
Comments
Post a Comment