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
Maha
NA
0
326.3k
Jumping out of the loop and list
Sep 29 2014 2:27 PM
Let us say input for the
while(true)
is x and y coordinates. As long as user provide x and y coordinates loop will continue. Any keystroke will terminate the loop and list relevant x and y coordinates. Following is an incomplete program please complete it.
using System;
class Program
{
static void Main(string[] args)
{
int i = 0;
while (true)
{
Console.Write("X = ");
double x = int.Parse(Console.ReadLine());
Console.Write("Y = ");
double y = int.Parse(Console.ReadLine());
Console.WriteLine();
i++;
}
x[i] = x;
y[i] = y;
double[] x = new double[i];
double[] y = new double[i];
Console.WriteLine("X Y");
Console.ReadKey();
}
}
Reply
Answers (
2
)
c# problem
Relationship DataTable and DataReader ?