Advertisement
smeacham

Temperature Conversion using for loop

Nov 6th, 2012
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. //
  2. //  main.m
  3. //  Temperature Conversion Table
  4. //
  5. //  Created by Steve on 11/6/12.
  6. //  Copyright (c) 2012 Personal. All rights reserved.
  7. //
  8.  
  9. #import <Foundation/Foundation.h>
  10.  
  11. int main(int argc, const char * argv[])
  12. {
  13.     // Iterate through Celcius, displaying Farenheight conversion.
  14.     for (float c = 0; c <= 300; c += 20) {
  15.         printf("%3.0f %6.1f\n", c, (9.0/5.0) * c + 32.0);
  16.     }
  17.    
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement