forum

home / developersection / forums / write another function for this code using c#

Write another function for this code using C#

E E Cummings 2542 05-Oct-2013
using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string numberIn;
            int numberOut;

            numberIn = Console.ReadLine();

            while (!int.TryParse(numberIn, out numberOut) || numberOut < 0)
            {
                Console.WriteLine("Invalid. Enter a number that's 0 or higher.");
                numberIn = Console.ReadLine();
            }
        }
    }
}

c# c# 
Updated on 05-Oct-2013
E E Cummings

Other


Message
Can you answer this question?

Answer

1 Answers

Liked By