I have written the following code but the when i enter value after that its the value 0 why please help me,
how can i add this two number
class program
{
int a,b,sum;
public int Sumation(int a,int b)
{
sum=a+b;
return sum;
}
static void Main()
{
int c,d,e;
Console.WriteLine("Enter Value of C & D");
c=int.parse(Console.ReadLine());
d=int.parse(Console.ReadLine());
Program p =new Program();
e=p.Sumation(c,d);
Console.WriteLine("Sum of two value is: "+ e);
console.ReadLine();
}
}
Reply |
Reply with attachment |
Alert Moderator