I have to create a program that converts temperature values from Fahrenheit to Celsius, ask the user to input the number of Fahrenheit temperature to be converted (n). Use a ‘for’ loop to read the temperatures from keyboard , output the original and converted temperatures in a tabulated format with two decimal points.
Calculate and output the average temperature in Celsius with two decimal points.
Below is what I have so far.... Am I right so far with what I have?
Code:#include <stdio.h> #include <conio.h> #include <math.h> #include <dos.h> #include <iostream> #include <string.h> void main () { int fahr, cel; printf ("Enter the starting temperature in degrees Fahrenheit: "); scanf("%d", &fahr); for( x = 0; x < 25; x++ ) { cel=(fahr-32)*5/9; printf("\n%d Fahrenheit is equal to %d degrees celsius\n\n",fahr,cel); } printf("\nPress any key to exit the program ...\n\n"); getche(); }