[Mono-list] Doubt on "Console.ReadLine()" !!!!!
nsharath
sharath.05131a0584 at gmail.com
Sat Feb 14 23:28:51 EST 2009
hello sir,
thanks a lot for telling me that there is an OPTION in the project menu.
Can u please tell me what is the option under "projects".I am not able to
locate it.
Please reply me the name of that option for taking input from TERMINAL or
console......
awaiting your reply !!!
nsharath wrote:
>
> hello sir,
> I am working on SUSE studio MONO 2.2.
> I am able to run the "Console.WriteLine()" perfectly.
> But the "Console.ReadLine()" is showing exceptions in the sample code.But
> this code is running perfectly on the Windows Visual studio 2008.
>
> My doubt is : "HOW TO READ INPUT FROM USER" ??????
>
> - - - - - - - - - - - - - SAMPLE CODE TO FIRST THE HIGHEST 2 NUMBERS IN
> GIVEN ARRAY - - - - - - - -
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
>
> namespace practice
> {
> class highest
> {
> public static void Main()
> {
> int n,first,second;
> Console.Write("enter size of array:");
> n = Int32.Parse(Console.ReadLine());
> int[] a = new int[n];
> for (int i = 0; i < a.Length; i++)
> {
> Console.Write("enter number{0}:", (i+1));
> a[i] = Int32.Parse(Console.ReadLine());
> }
> Big_func(a, out first, out second);
> Console.WriteLine("FIRST HIGHEST = " + first);
> Console.WriteLine("SECOND HIGHEST = " + second);
> }
> public static void Big_func(int[] a, out int first, out int
> second)
> {
> first = 0;
> second = 0;
> foreach(int i in a)
> {
> if (i > first)
> {
> second = first;
> first = i;
> }
> else if (i > second && i < first)
> {
> second = i;
> }
> }
> }
> }
> }
>
> - - - - - - - - - - - - - the end - - - - - - - -
>
>
--
View this message in context: http://www.nabble.com/Doubt-on-%22Console.ReadLine%28%29%22-%21%21%21%21%21-tp21992667p22019688.html
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list