Loops. Loop with parameter (for)




Each part of the header can have multiple statements separated by commas.
Header examples:
	for ( i = 0; i < 10; i ++ ) { ... }
        //standart header
	for ( i = 0, x = 1.; i < 10; i += 2, x *= 0.1 ){ ... }   
        //in this case, we use two variables that will change after the execution of the loop body - these are the variables i and x
         // variable i changes in increments of 2:  i + = 2 - abbreviated notation from i = i + 2
         // variable x with each step increases by 0.1 times x = x * 0.1 - abbreviated x * = 0.1

Task
Change the title of the loop so that the values of two variables i and b are outputed
The value of variable i should vary from 1 to 5, and the value of variable b from 5 to 1
The output should be like this:
1 5
2 4
3 3
4 2
5 1
Please note that you only need to change the title of the loop!
C++
1
#include <iostream>     
2
using namespace std;   
3
main()   {     
4
int i,b;     
5
6
  cout << i << " " << b << "\n";     
7
}     
Your last submission is saved in the editor window.
     

Results:

All results: