How to use two variables in for loop with C#

1 Answer

0 votes
using System;

class Program
{
    static void Main()
    {
       for (int i =5, j = 0; i >= 0; i--, j++) { 
            Console.WriteLine(i + " : " + j);
       }
    }
}


/*
run:

5 : 0
4 : 1
3 : 2
2 : 3
1 : 4
0 : 5

*/

 



answered May 10, 2019 by avibootz

Related questions

1 answer 267 views
1 answer 266 views
1 answer 308 views
1 answer 281 views
281 views asked May 10, 2019 by avibootz
1 answer 256 views
1 answer 247 views
1 answer 248 views
...