do...while | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

do...while

A question, in the code int num; do { cout << " enter a number:" ; cin>>number; if ( number>100 ) cout <<" re-enter\n" ; } while ( number >100 ) ; ¿ what is being valited?

13th Apr 2019, 6:32 AM
El Patriarcado
El Patriarcado - avatar
5 Answers
+ 3
The program perseveres until a number <= 100 is entered.
13th Apr 2019, 1:56 PM
Sonic
Sonic - avatar
+ 4
If u have a number greater than 100, the program will ask you to re enter a number once again till its below 100, them proceed to the while and execute the block of code. Though these some error in your loop as they test similar condition.
13th Apr 2019, 7:24 AM
washie mugo
washie mugo - avatar
+ 2
thank you Washie 😶☺
13th Apr 2019, 7:27 AM
El Patriarcado
El Patriarcado - avatar
+ 1
You are welcome Rosa
13th Apr 2019, 7:28 AM
washie mugo
washie mugo - avatar
+ 1
thank you very much Sonic 🙂
13th Apr 2019, 2:06 PM
El Patriarcado
El Patriarcado - avatar