Q:

Write a C# Sharp program to check if y is greater than x, and z is greater than y from three given integers x,y,z

0

Write a C# Sharp program to check if y is greater than x, and z is greater than y from three given integers x,y,z

Sample Output:

True
True
False

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
using System.Linq;
namespace exercises
{
   class Program
    {       
        static void Main(string[] args)
        {
            Console.WriteLine(test(1, 2, 3));
            Console.WriteLine(test(4, 5, 6));
            Console.WriteLine(test(-1, 1, 0));
            Console.ReadLine();
        }
        public static bool test(int x, int y, int z)
        {
            return x < y && y < z;
        }
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now