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
Prime b
NA
810
346k
Another loop !
Jan 4 2012 11:50 PM
The problem
Write a console-based application that displays every
integer value from 1 to 20, along with its squared value.
This is what I have done. All I am curious is if there another way to do it, other than while,do loops.
double max = 20;
double math, mathDouble;
for (double x = 1; x <= max; ++x)
{
math = x * 1;
mathDouble = math * math;
Console.WriteLine("The number is {0}, the square root of that number is {1}", math, mathDouble);
Reply
Answers (
3
)
Problem with loops
Word manipulation