TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
13
2.6k
adding a nested if statement
Dec 15 2018 2:57 PM
add a nested if statement 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;
}
Console.WriteLine(output);
}
}
}
Reply
Answers (
1
)
loop that identify values
bit of maths problem