TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jaguRita
NA
40
0
Check for an Integer Value-Without Exception
Aug 10 2007 2:52 AM
Hello all,
I want to multiply a number by itself,and the number must be Integer.A program, when i get the input number as a string it wont take it as the input n it will show an error "You are not entered Integer,try with some other number".(Without use of exceptions),Is there any possiblity?
i have written one code.But it shows an exception at run time.
int number=int.parse(console.ReadLine());
if (number <= int.MaxValue && number >= int.MinValue)
{
Console.Write("\n Enter the number :");
number *= number;
Console.WriteLine(number);
}
else
{
Console.WriteLine("You are not entered Integer,try with some other number");
}
Whats wrong with my code?How will i write the code only it will accept Integers not an decimal or string.
or Some Clues to do it.I will find out the way.
As am learner i want to know the things.
Thanks.
Reply
Answers (
2
)
creating a new form
Creating *.doc files