Should output success if I is within 5 units of j… im getting failure with this code
- 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);
- }
- }

Jignesh KumarRank #91 · 22.9K reputationPosted Dec 1, 2018, 10:56 AM EST