Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
I have input problem...! plz solve this
Asad Mairaj
16y
2.1k
1
Reply
hi em new in C# my problem is that i want to take input as integer value.....!
if user gives input <0 and >999 then it takes again input until they enter correct integer.
{
int mynum;
String number;
Console.WriteLine("Please Enter the roll number");
number = Console.ReadLine();// this is used for take input as a string
mynum = int.Parse(number); // this is used for to convert String nto integer.
if(mynum < 0 || mynum > 999)
{
Console.WriteLine("Please Enter the roll number");
// i know while loop is execute here bt i dont know how to use it.
}
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
URL escape issue
Download C#, Visual Studio, SQL Server 2008, Expression Blend Videos...