The output of the following code is very weird for me to understand.Can anybody explain me why it's behaving that way?
#include<stdio.h>
int main()
{
int i=0;
char ch='a';
while(ch!='q')
{
scanf("%c",&ch);
printf("\t%d\n",i);
i++;
}
}
Output