Example 1 : Generates a fahr-celcius conversion table #include using namespace std; int main() { int low, high, skip; float cel, fahr; cout << "Input lower limit, upper limit and skip value \n"; cin >> low >> high >> skip; cel = low; do { fahr = 32 + (9*cel)/5; cout << cel << " " << fahr <<"\n"; cel = cel + skip; } while (cel < high +1); return 0; } Example 2 : Generates primes less than 100 #include using namespace std; int main() { int a,b; a=2; while(a<=100) { b=2; while(b<=a) { if ((a%b)==0) { break; } else { b=b+1; } } if (b==a) cout << a << "\n"; a=a+1; } return 0; }