Answer to Question #251915 in C# for Holik

Question #251915
39. Two real numbers are given. Display the first
a number if it is greater than the second, and both numbers if it is
not this way.
1
Expert's answer
2021-10-17T09:29:16-0400
using System;
using System.Collections.Generic;


namespace App
{
   
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Ente a: ");
            float a = float.Parse(Console.ReadLine());
            Console.Write("Ente b: ");
            float b = float.Parse(Console.ReadLine());
            if (a > b) {
                Console.WriteLine("a is greater than b.");
            }
            else if (a < b)
            {
                Console.WriteLine("b is greater than a.");
            }
            else {
                Console.WriteLine("The numbers a and b are the same.");
            }


            Console.ReadLine();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS