#include<stdio.h> 
int main()
{
int x=5;
int y=50;

do{
x = x + 10; 
}while (x <y);
printf("%d\t%d", x,y);
}

I wonder why i compile is 55 50
why not 15 50???

The loop continues as long as x is less than y. It isn't until x = 55 that the test fails.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.