thenewboston

C Programming Tutorial - 25 - while Loops

Aug 22nd, 2014
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int day = 1;
  7.     float amount = .01;
  8.  
  9.     while(day <= 31){
  10.         printf("Day:%d \t Amount:$%.02f \n", day, amount);
  11.         amount *= 2;
  12.         day++;
  13.     }
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment