1: using System;
2:
3: namespace st
4: {
5: class Highest
6: {
7: static void Main()
8: {
9: int highest = 0;
10: while (true)
11: {
12: Console.Write("Enter a number :");
13: string input = Console.ReadLine();
14: int num = Int32.Parse(input);
15: // stop if user's input is 0
16: if (num == 0)
17: break;
18: if (num > highest)
19: highest = num;
20: }
21: Console.WriteLine("Highest of all numbers is : {0}", highest);
22: } // main
23: } // class
24: } // st
Comments
Post a Comment