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
Song Lee
NA
47
38.4k
Adding up numbers by 6
Sep 27 2014 6:23 PM
Hello C-Sharpcorner,
I want to know how to add numbers by 6, starting from #6
(so, 6->12->18->24.. so forth until 100)
-----------------------------------------------------------------------------------------------
private void
six()
{
Console
.WriteLine(
"the number will go up by 6"
);
double
sixStart =6;
//Below is the nooby method that I came up with
//But I want to know if there is something better than doing this for individual numbers
Console
.WriteLine("
2nd # ={0}
", sixStart + 6);
Console
.WriteLine("
3rd # ={0}
", sixStart +12);
//Are there any formulas to replace this...?
}
Reply
Answers (
3
)
c# update mdb
c# programming doubt