1
Answer

return value from a method

Photo of taks kamps

taks kamps

6y
596
1
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)