Hi All,
This is a small piece of code shown below which is using do while loops. I really dont understand the unexpected behaviour i see when i execute this code.This code shown below uses a do while loop condition and from my knowledge a do while loops executes in such a way that if first executes the statement and then checks in the while part if the condition is true or not.But when i execute this code it never comes out of the loop and goes on forever.Can anyone please tell me why is it happening?
unsigned int A = 5;
int B = 0;
main()
{
do
{
A = A + 5;
B = B - 1;
}while(B > A);
printf("hello\n");
}
Now i never get the "hello" printed.
Thanks in advance Maddy