Skip to main content

Posts

Showing posts with the label loop

C++ Do-While Loop

Example 1 #include &ltiostream&gt using namespace std; int main() { int count=0; double num, total = 0, average; cout > num; if (num == 0) break; count++; total = total + num; cout Example 2 #include &ltiostream&gt using namespace std; int main() { int opt; do { cout > opt; switch (opt) { case 1: cout