printf(“enter a number:”);
its simple, for loop is a conditional statement in which we apply the three condition first we initialize, then provide a range in which the condition is executed, and next update the value.
according to your code
for(i=1; i<=n; i++)
i=1; - in this line you first initialized
i<=n; -you provide the range in which your condition is executed.
i++; - it is firstly print the current value then update the value than print value so on and so forth.
thanks i was doing well but loops are a bit difficult for me. Any suggestions to do loops