I think you mean > instead of <:

for (int i = 10; i > 0; --i) {

If you want the values of i to be the same as in the original code except in reverse order (i.e. 9, 8, 7, ..., 1, 0) then you also need to change the boundaries:

for (int i = 9; i >= 0; --i) {
Answer from Mark Byers on Stack Overflow
🌐
Tutorial Gateway
tutorialgateway.org › for-loop-in-c-programming
For Loop in C Programming
February 7, 2026 - Step 1 (Initialization): We initialize the counter variable(s). It is an entry to the for loop. Example, i=1. Step 2 (Expression): It will check the condition against the counter variable. Step 3: If the condition is True, the compiler moves to the group of statements section and executes the statements inside it. Step 4 (Update): After completing the iteration Step 3 (from the group of statements section), it will execute the Increment and Decrement Operators inside it to increment or decrease the value.
🌐
Quora
quora.com › How-we-can-use-loop-in-C-to-decrement-the-number-from-10-to-1
How we can use loop in C to decrement the number from 10 to 1? - Quora
Answer (1 of 48): use decrement function that is(- -) use this : for(i=10;i>0;i- -) { printf(“%d”,i); }
Discussions

decrement size_t in loop - C++ Forum
Hi everyone, I was recommended ... warnings for debugging purposes. The compiler frequently complained that I was comparing signed and unsigned integers in my loop heads. Thinking it to be better practice to turn all loop counters to size_t, I ran into a problem with a loop that is supposed to decrement to 0 and exit ... More on cplusplus.com
🌐 cplusplus.com
June 9, 2022
Decrementing Initialization of a For Loop (C) - EX: for(i--; i>0; i--) - Stack Overflow
I have been reading about operating system design in the book, "The Xinu Approach 2nd Ed.", and came across a for loop statement in chapter 10 on page 182/183. The for loop starts off More on stackoverflow.com
🌐 stackoverflow.com
Solved! help with decrementing a for loop
This is a continuation of a previous program question. Although this is ver specific. I am trying to get my display of 12 LEDs to light up using parrterns defined by arrays. I have been successful, and have even successfuly written a switch case to move between multiple patterns. More on forum.arduino.cc
🌐 forum.arduino.cc
0
0
August 5, 2020
Output when using pre decrement in for loop in C - Stack Overflow
As you can see this the code in C, here I have used in for loop --i for decrement but I am not getting the expected output. Please explain #include #include int ma... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Programtopia
programtopia.net › home › c programming › for loop in c programming
for loop in C Programming - Programtopia
January 15, 2021 - In this part, the variable required for the loop is initialized. It is executed only once at the first iteration. This part is optional and may be absent. ... for(i=0; condition; increment/decrement) for( ; condition; increment/decrement) // initialization is absent
🌐
Cprogramming
cboard.cprogramming.com › c-programming › 7564-increment-decrement-loop.html
Increment/Decrement for loop?
December 22, 2001 - View Forum Posts · Visit Homepage Code Goddess · Join Date · Sep 2001 · Posts · 9,897 · Well, as it is you have an infinite loop because you use the variable j in three loops that depend on each other. Two increment and one decrements, so you'll most likely not get the output you wanted.
🌐
Txstate
userweb.cs.txstate.edu › ~js236 › 201112 › cs1428 › lecture13.pdf pdf
Ch 5. Looping Increment and Decrement
Ch 5. Looping · Part 2 · CS 1428 · Fall 2011 · Jill Seaman · Lecture 13 · 2 · Increment and Decrement · Loops commonly have a counter variable · Inside the loop body, counter variable is often · − · incremented: increased by one OR · − · decremented: decreased by one ·
🌐
Newtum
blog.newtum.com › while-loop-decrement-in-c
While Loop Decrement in C - Newtum
July 29, 2024 - This is called “initialization.” Next, we have given the condition and after that, we have given the decrement. Now, the only thing is the printf statement. Instead of printf, we can write any logic that we want, So What we understand is for Loop execution.
Find elsewhere
🌐
Cplusplus
cplusplus.com › forum › beginner › 283889
decrement size_t in loop - C++ Forum
June 9, 2022 - As size_t will never become -1 (instead it seems to become the largest possible value), this will turn into an infinite loop. Fortunately, the compiler warned me about this as well. How can I write the following correctly? for (size_t i = my_vector.size() - 1; i >=0; i -= my_decrement) Best, PiF
🌐
Unstop
unstop.com › home › blog › for loop in c explained with detailed code examples
For Loop In C Explained With Detailed Code Examples
January 12, 2024 - The decrement for loop is similar to the simple increment loop but starts with a higher initial value and decrements i by 1 after each iteration until the condition (i > end) becomes false.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › increment-and-decrement-operators-in-c
Increment and Decrement Operators in C - GeeksforGeeks
May 21, 2025 - The increment ( ++ ) and decrement ( -- ) operators in C are unary operators for incrementing and decrementing the numeric values by 1, respectively. They are one of the most frequently used operators in programming for looping, array traversal, ...
🌐
BeginnersBook
beginnersbook.com › 2014 › 01 › c-for-loop
C – for loop in C programming with example
This is one of the most frequently used loop in C programming. Syntax of for loop: for (initialization; condition test; increment or decrement) { //Statements to be executed repeatedly }
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Solved! help with decrementing a for loop - Programming - Arduino Forum
August 5, 2020 - This is a continuation of a previous program question. Although this is ver specific. I am trying to get my display of 12 LEDs to light up using parrterns defined by arrays. I have been successful, and have even successfuly written a switch case to move between multiple patterns.
🌐
HowtoForge
howtoforge.com › home › c command line tutorial 6 - code indentation, increment/decrement operators, do-while and for loops, and more
C Command Line Tutorial 6 - Code indentation, increment/decrement operators, do-while and for loops, and more
February 25, 2019 - Next up is 'for' loop, which like 'while' has a condition to check, but also has an increment statement or decrement statement that's helpful in many cases.
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_for_loop.htm
For Loop in C
In this case, the initial value of the looping variable is more than its value in the test condition. The last clause in the for statement uses decrement operator.
🌐
WsCube Tech
wscubetech.com › resources › c-programming › increment-decrement-operators
Increment and Decrement Operators in C (With Examples)
March 3, 2026 - Learn in this tutorial about C increment and decrement operators, including pre-increment, post-increment, pre-decrement, and more, with examples. Read now!