Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- /*Use a function to print a Fahrenheit-Celsius conversion table using the formula C=(5/9)*(F-32) with a step of 20 between values of 0 t 300 of Fahrenheit temperatures*/
- #define STEP 20
- int Convert(int f);
- main()
- {
- int i, sum=0;
- int array[16];
- for (i=0;i<16;++i)
- {
- if (i!=0)
- {
- sum=sum+STEP;
- }
- array[i]=sum;
- }
- for (i=0;i<16;++i)
- {
- printf("%d\t%d\n",array[i],Convert(array[i]));
- }
- }
- int Convert (int f)
- {
- int c;
- c=5*(f-32)/9;
- return c;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement