/* * File Name : double_it.c * Title : Double It! * Author : Buff Furman * Created : 12SEP2009 * Revised : 12SEP2009 * Version : 1.0 * Description : Example of using a for loop to count to 10 and double the count * Inputs : none * Outputs : count and 2*count * Method : Declare and initialize variables * for i=0 to i<=10 * print i and 2*i i++ * End * Revision History: * Date Who Description of Change * ------- --------- --------------------------- * 12SEP2009 BF Created program */ /*---------Include Files--------------*/ #include /* standard IO library routines, like printf, scanf */ /*---------Macros---------------------*/ /* none in this program */ /*---------Function Prototypes--------*/ /* none in this program */ /*---------Global Variables-----------*/ /* none in this program */ /*---------Body of Program Code-------*/ int main(void) { /* Declare variables */ int i; /* counter variable */ for(i=0; i<=10; i++) printf("%3d %3d\n",i, 2*i); return(0); }