//Write a program to find the biggest number in n numbers without using arrays. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace biggestnumber { class Program { static void Main(string[] args) { int ntimes = 0,biggest_number=0,num=0; Console.Write("How many times you want to enter the number : "); ntimes = int.Parse(Console.ReadLine()); for (int i = 1; i <= ntimes; i++) { Console.Write("Enter {0} Number ",i); num = int.Parse(Console.ReadLine()); if (biggest_number< num) biggest_number = num; } Console.WriteLine(); Console.WriteLine("The biggest Number : " + biggest_number); Console.ReadKey(); } } }
Sunday, 27 January 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment