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
Lovemore Kutseya
NA
21
3.8k
( inclusive) output something if its within a range
Dec 17 2018 4:36 PM
should output Success if i is within 5 units of j (inclusive), but it doesn't work
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
string output;
int i = 10;
int j = 10;
if ((i > j + 5) || (i > j - 5))
{
output = "Success";
}
else
{
output = "Failure";
}
Console.WriteLine(output);
}
}
}
Reply
Answers (
2
)
Getting error and warning in window application in C# VS
splitting a string into an array of strings