Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

/*************************************************************************

* Passing Parameters and Return from Method Example


*
*************************************************************************/

using System;
namespace MyProject.Examples
{
class ExampleOne
{
public static void Main()
{
int num1 = 0, num2 = 0;
//Accepting Values from users
Console.Write("Enter first number\t\t");
num1 = Convert.ToInt32(Console.ReadLine());

Console.Write("\n\nEnter second number\t\t");


num2 = Convert.ToInt32(Console.ReadLine());

ExampleOne eOne=new ExampleOne();


eOne.sum(num1, num2);

Console.ReadKey();
}

public int sum(int no1,int no2)


{

int add = no1 + no2;


return add;
//
}
}
}

You might also like