/*********************************************************** guess2.ch Introduction to Ch This program introduces the while loop. A while loop continues to run until the while condition is false. If the while condition is false, the program will break out of the loop and continue running the instructions after the loop. ************************************************************ Copyright 2014 SoftIntegration Inc. http://www.softintegration.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ***********************************************************/ // initialize variables int number; // ask user to enter a number to count down from printf("enter a number between 1 and 50: "); scanf("%d", &number); // while the variable 'number' is greater than or equal to zero // run the instructions in the while loop while (number >= 0) { printf("%d\n", number); number = number - 1; // subtract 1 from number } // the program continues here after the while condition is falsified. printf("Blastoff!\n");