How about friends, I have a very big question with the FOR loop, why does not this code give me results ??? That is, it does not run
#include<stdio.h>
int main()
{
int i=0;
for (i=10;i<=0;i--)
printf(" %d ",i);
}
However, doing a bit of research, I found the following, which works perfectly.
#include<stdio.h>
int main()
{
signed int i=0;
for (i=10;i>-1;i--)
printf(" %d ",i);
}
My question is: why the first code does not work and the second yes, because C
does not understand the parameter <=0
? Thanks in advance, I am a self-taught beginner and I have some doubts.