Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

C programming help

By: a guest on Jun 25th, 2012  |  syntax: C  |  size: 0.55 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     double weight, miles, rate370;
  7.    
  8.     printf("How heavy is the package in pounds . \n");
  9.     scanf("%lf", &weight);
  10.     printf("The package weighs : %.2lf \n", weight);
  11.    
  12.     printf("How many miles are you shipping the package .\n");
  13.     scanf("%lf", &miles);
  14.     printf("You are shipping the package %.2lf \n", miles);
  15.    
  16.     if ( weight <= 5.6 )
  17.     {
  18.         rate370 = (int) miles / 500 * 3.7;
  19.         printf("Your total cost : %.2lf\n", rate370);
  20.        
  21.     }
  22.  
  23.    
  24.    
  25. }
clone this paste RAW Paste Data