Forums - C# Corner

Forum guidelines
taks kamps

taks kamps

  • 1.7k
  • 39
  • 1.1k

return value from a method

Dec 14 2018 5:30 PM
Call the Add method passing in i and j. Assign the result of the method to iPlusj... code below of what i have done so far
 
using System;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int i = 5; int j = 2;
int iPlusj;

Add();
iPlusj = 7;

Console.WriteLine(iPlusj);
}

static int Add(int pLHS, int pRHS)
{
return pLHS + pRHS;
}
}
}

Answers (1)