Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- double a, b, c;
- Console.WriteLine("Enter the number");
- a = Convert.ToDouble(Console.ReadLine());
- b = Convert.ToDouble(Console.ReadLine());
- c = Convert.ToDouble(Console.ReadLine());
- Console.WriteLine(S(a,b,c));
- }
- static double S(double a, double b, double c)
- {
- double s = 0;
- if ((a < b && b < c) || (a > b && a < c))
- {
- s = 0.5 * a * b;
- } else {
- if (a < b && a > c)
- {
- s = 0.5 * a * c;
- } else
- {
- s = 0.5 * b * c;
- }
- }
- return s;
- }
- }
- }
Add Comment
Please, Sign In to add comment