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
taks kamps
NA
39
6.8k
nested if's statements
Dec 14 2018 9:00 PM
a nested if statement after the assignment of string1 to result,
such that if i is greater than 5 and j is less than 5 append string2 to the result... some code i have done so far
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int i = 10; int j = 5;
const string string1 = "Foo";
const string string2 = "Bar";
string result = "";
if(i > j)
{
result = string1;
if ((i>5) & (j<5))
{
result = string2;
}
}
Console.WriteLine(result);
}
}
}
Reply
Answers (
1
)
while loop that is repeated
How to search in datatable by datetime