1
Answer

only 4 integers allowed?

Hideki Snk

Hideki Snk

17y
2.1k
1
Hi,
here the question.. i wanted to knw if i can set the limit of the input that user can keyin only 4 integers number.. by default, i use this kind of code ..
input:
                Console.WriteLine("4 integers number");
            Console.Write("  User input: ");
            int j = int.Parse(Console.ReadLine());
            if ((j < 1000) || (j > 10000))
            {
                Console.Clear();
                Console.WriteLine("Error!!Please input 4 digit integers");
                goto input;
            }

by the way, if u see the code.. 0000-0999 cant be read since the condition is 1000-10000..
so is there anyway to solve this problem so that i can input 0000-0999?
Answers (1)