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
๐ŸŒ
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); }
๐ŸŒ
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.
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
๐ŸŒ
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 ยท
๐ŸŒ
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
๐ŸŒ
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, ...
๐ŸŒ
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.
๐ŸŒ
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 }
๐ŸŒ
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.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ while-loop-in-c
While Loop in C Programming
March 23, 2025 - At the beginning, the While loop checks for the condition. If the condition is True, then it will execute the statements inside of it. Next, we have to use the Increment & Decrement Operator inside it to increment and decrement the value.