Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Considering C++ language, what is the difference between While loop and do...while loop ?

user-image
Question added by هاشم المشارقة , Key Account Manager , Advanced United Systems Ltd. ( A member of Taj Holding Group)
Date Posted: 2016/02/02

the differnce between while loop and do while loop is simply with a do while loop your program tells the compliler to do whatever you want to first then checking your condtion..

but the while it will check your condtion first

 

for example:

 

while( x !=) {

     x = x+5;

}

do {

x * x;

}while(x!=);

 

 

 

 

 

More Questions Like This