Copyright (C) 2014 Software 1 class//All rights reseved.//Author: A36 Huanghade//Completion Date: December 4, 2014////problem Description: Create a program to find the minimum and maximum values for four numbers, and then output//Enter a description : Enter four real numbers//output description: Two numbers, Min and Max//using system;using system.collections.generic;using system.linq;using system.text;using System.threading.tasks;namespace consoleapplication1{class Program {static void Main (string[] args) {Double one, minone, maxone;//define variable one,two,three,four four number, min: Minimum, MZX: Max Console.WriteLine ("Please enter 1th Number: ");//Prompt to enter one = double. Parse (Console.ReadLine ()); Minone = one; Maxone = one; for (int i =2; I <=4; i++) {Console.WriteLine ("Please enter the number of {0}", i); one = Double. Parse (Console.ReadLine ()); if (one > Maxone) maxone = one; else if (one < Minone) Minone = one; } Console.WriteLine ("Minimum value: {0}\n max: {1}", Minone, Maxone); Console.readkey (); } }}
Find maximum and maximum values in four numbers