Will Web 3.0 Replace Web 2.0?
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Lovemore Kutseya
2.2k
21
2.9k
( 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