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
Amit Mohanty
15
51.1k
5.8m
Nested for loops for N times in C#.
Sep 3 2019 5:24 AM
How to nested for loops for n times ?
Ex.
int
nLoop = 4;
for
(
int
i = 0; i <= 10; i++)
{
for
(
int
j = 0; j <= 5; j++)
{
for
(
int
k = 0; k <= 12; k++)
{
for
(
int
l = 0; l <= 5; l++)
{
Console.WriteLine(i +
" "
+ j +
" "
+ k +
" "
+ l);
}
}
}
}
So if nLoop is 2 then there would only be 2 for loops i and j
if nLoop is 3 then there would only be 3 for loops i, j and k.
Reply
Answers (
4
)
How to assign the multiple specific roles in single user?
SignalR and using jquery and c#