Two things:
1) To add to what Wendelius says, this may help:
Why does x = ++x + x++ give me the wrong answer?[
^] - it doesn't exactly apply to your code, but it explains what the operators do, which may hep you understand why your code doesn't do what you expected.
2) Indent your code!
If you don't your code becomes mush harder to read, and that means you can make mistakes a lot easier.
#include<stdio.h>
int main ()
{
int i = 5;
while(i-- >=0)
printf("%d,",i);
i = 5;
printf("\n");
while(i-- >=0)
printf("%d,",i);
while (i-- >=0)
printf("%d,",i);
return 0;
}
It's also a lot safer to always use curly brackets to delimit blocks:
#include<stdio.h>
int main ()
{
int i = 5;
while(i-- >=0)
{
printf("%d,",i);
}
i = 5;
printf("\n");
while(i-- >=0)
{
printf("%d,",i);
}
while (i-- >=0)
{
printf("%d,",i);
}
return 0;
}