/*while loop example*/ int main() { int sum = 0; int cnt = 0; while(sum < 10) { sum = sum + cnt; cnt = cnt + 1; } return sum; }