This is the first code
int main()
{
int ch;
while(ch)
{
ch=getch();
printf("%d",ch);
printf("\n");
}
return 0;
}
if in the above code I input
up arrow key
down arrow key
right arrow key
left arrow key
RESPECTIVELY the the outputs are as following
224
72
224
80
224
77
224
75
but if I remove the LOOP from the code ie
int main()
{
int ch;
ch=getch();
printf("%d",ch);
printf("\n");
return 0;
}
and input
up arrow key
down arrow key
right arrow key
left arrow key
RESPECTIVELY then the outputs are as follows
224
224
224
224
From where
224
is coming in the first code and after removing the LOOP where the following numbers are gone
72
80
77
75