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
harish reddy
NA
162
33.9k
Console Readline
Jun 3 2017 2:02 AM
Console.WriteLine("Input the length and breadth");
int a = 10;
Console.WriteLine("Lenght of the rectangle is" + " " + a );
Console.Writeline("Now enter the \"breadth\" of rectangle");
Console.ReadLine();
int b = int.Parse(Console.ReadLine());
int Perimeter = 4*(a*b);
int Area = a*b;
Console.WriteLine("The perimeter of rectangle is" + " "+ Perimeter);
Console.WriteLine("The area of rectangle is" + " " + Area);
First question :
In the above program if i comment out console.readline(); , then i am getting the output.
But, if i dont comment out console.readline();, then i am getting an exception error. Why?
second Question:
When the fourth line of code is executed i.e Console.Writeline("Now enter the \"breadth\" of rectangle"); i am getting a cursor mark to input the value from user. But the same cursor mark is not appearing where there are other console.writeline . Why?
Third question:
I have confusion when we use Console.readline(); What does this do?
Reply
Answers (
7
)
I have been trying to add image in my crystal report.
How To Use Group Join In C# Linq.