such that when the sum of i and j is greater than twenty if i and j are also within 3 units of each other exclusive append result2 to the output
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int i = 10; int j = 5;
const string result1 = "Rock";
const string result2 = "Paper";
string output = "";
if(i + j > 20)
{
output += result1;
if ((i <= j + 3 )&& (j <= i -3))
{
output += result2;
}
}
Console.WriteLine(output);
}
}
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int i = 10; int j = 5;
const string result1 = "Rock";
const string result2 = "Paper";
string output = "";
if(i + j > 20)
{
output += result1;
if ((i <= j + 3 )&& (j <= i -3))
{
output += result2;
}
}
Console.WriteLine(output);
}
}
Jeeva SubburajPosted Dec 18, 2018, 2:05 PM
Jeeva SubburajPosted Dec 18, 2018, 2:03 PM
anndy smaalsPosted Dec 18, 2018, 1:53 PM
Jeeva SubburajPosted Dec 18, 2018, 1:32 PM