A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a C# Sharp program to find the largest of three numbers
Q:

Write a C# Sharp program to find the largest of three numbers

0

Write a C# Sharp program to find the largest of three numbers

Sample Output:

Find the largest of three numbers:                                                                            
------------------------------------                                                                                                  
Input the 1st number :20                                                                                      
Input the  2nd number :25                                                                                     
Input the 3rd  number :15                                                                                     
The 2nd Number is the greatest among three

All Answers

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

using System;  
public class Exercise8  
{  
    public static void Main()
{
    int num1, num2, num3;
    Console.Write("\n\n");
    Console.Write("Find the largest of three numbers:\n");
    Console.Write("------------------------------------");
    Console.Write("\n\n");

    Console.Write("Input the 1st number :");
    num1 = Convert.ToInt32(Console.ReadLine());
    Console.Write("Input the  2nd number :");
    num2 = Convert.ToInt32(Console.ReadLine());
    Console.Write("Input the 3rd  number :");
    num3 = Convert.ToInt32(Console.ReadLine());
 
  if (num1 > num2)
    {
        if (num1 > num3)
        {
            Console.Write("The 1st Number is the greatest among three. \n\n");
        }
        else
        {
            Console.Write("The 3rd Number is the greatest among three. \n\n");
        }
    }
    else if (num2 > num3)
        Console.Write("The 2nd Number is the greatest among three \n\n");
    else
        Console.Write("The 3rd Number is the greatest among three \n\n");
}
}

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