Electrical and Computer Engineering
24
of 31
UAH
CPE 112
Example Using
break
and
continue
(num1 = 2, num2 = 55, loopCount = 15)
•
loopCount = 1;
•
while
(
true
)
•
{
•
cin >> num1;
•
if
(!cin || num1 >= 100)
•
continue
;
•
if
(!cin || num2 <= 50)
•
continue
;
•
cout << sqrt(float(num1 + num2)) << endl;
•
loopCount++
•
if
(loopCount > 10)
•
break
;
•
}