Beispiel Zählschleife

for.cpp
#include <iostream>
 
int main()
{
  std::cout << "aufsteigend: ";
 
  for (int i = 0; i < 10; i++)
  {
    std::cout << i << ' ';
  }      
  std::cout << "\nabsteigend:  ";
 
  for (int i = 9; i >= 0; i--)
  {
    std::cout << i << ' ';
  }
  std::cout << '\n';
}