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
8
Answers
I want only Integer Input...!
Asad Mairaj
16y
11k
1
Reply
hi em new in Csharp Language...!
i want take only Integer input or you can say any number...!
if user enter any character then it takes input again until they enter correct number....!
my code is:
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.
// i dont konow what is the next step for take only integer input
Post
Reset
Cancel
Answers (
8
)
Next Recommended Forum
PAC file parsing in C#
Some help with a small piece of code