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 272 views
1 answer 269 views
1 answer 311 views
1 answer 288 views
288 views asked May 10, 2019 by avibootz
1 answer 259 views
1 answer 252 views
1 answer 253 views
...