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 179 views
1 answer 185 views
1 answer 214 views
1 answer 196 views
196 views asked May 10, 2019 by avibootz
1 answer 175 views
1 answer 167 views
1 answer 159 views
...