c for loop decrement

#include <iostream>

int main() {
    for (int i = 5; i >= 1; --i) {
        std::cout << i << " ";
    }
    return 0;
}
  1. Include the necessary header file for input/output operations.
  2. Define the main function.
  3. Initialize a variable i with the value 5.
  4. Start a for loop with the initialization, condition, and iteration parts.
  5. Check if i is greater than or equal to 1.
  6. Execute the body of the loop if the condition is true.
  7. Output the current value of i followed by a space.
  8. Decrement the value of i by 1.
  9. Repeat steps 5-8 until the condition becomes false.
  10. End the for loop.
  11. Return 0 to indicate successful program execution.