C program to Convert Fahrenheit to Celsius - Fahrenheit and Celsius are two unit for measure temperature. Using standard formula we can change temperature. Tutorials, Free Online Tutorials, sitesbay provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql. C program converts fahrenheit to celsius. /. Two common temperature scales are Fahrenheit and Celsius. The boiling point of water is 212° F, and 100° C.
Dev C++ Fahrenheit To Celsius Converter 2
Hi everyone. I'm fairly new to C++ and I'm wondering if anyone can help me with this code. My assignment was to write a program that creates and displays a table of temperature conversions. Get the starting temperature from the keyboard in degrees Celsius (do not allow input of a value below absolute zero). Also get an integer value to represent the number of degrees to increment for each of a 20 row table (do not allow the increment value to be less than one. This is what I have so far
#include <iostream> #include <iomanip> using namespace std; int main() { double C,F,K,R,n,i; cout <<'Enter starting temperature in Celsius: '; cin >> C; while (C <= -273.15) { cout <<'ERROR: Temp must be >= -273.15: '; cin >> C; } { n = n--; cout << 'Enter increments in degrees Celsius: '; cin >> n; } { i= 1; i++; F= C * 1.8+32; K= C + 273.15; R= C * 1.8+32+459.67; } { cout <<' #t Celst Fahrt Kelvt Rank' <<endl; } cout <<' ' << n << setw(4) << ' ' << C << setw(4) << ' ' << F << setw (6) << ' ' << K << setw (6) << ' ' << R << endl; } But when I put this through it only brings up the specfic thing I asked for and not the whole table. The program needs to output like this Enter starting temperature in Celsius: -500 ERROR: Temp must be >= -273.15: -273.15 Enter increments in degrees Celsius: 100 # Cels Fahr Kelv Rank 1 -273.15 -459.67 0.00 0.00 2 -173.15 -279.67 100.00 180.00 3 -73.15 -99.67 200.00 360.00 4 26.85 80.33 300.00 540.00 5 126.85 260.33 400.00 720.00 6 226.85 440.33 500.00 900.00 7 326.85 620.33 600.00 1080.00 8 426.85 800.33 700.00 1260.00 9 526.85 980.33 800.00 1440.00 10 626.85 1160.33 900.00 1620.00 11 726.85 1340.33 1000.00 1800.00 12 826.85 1520.33 1100.00 1980.00 13 926.85 1700.33 1200.00 2160.00 14 1026.85 1880.33 1300.00 2340.00 15 1126.85 2060.33 1400.00 2520.00 16 1226.85 2240.33 1500.00 2700.00 17 1326.85 2420.33 1600.00 2880.00 18 1426.85 2600.33 1700.00 3060.00 19 1526.85 2780.33 1800.00 3240.00 20 1626.85 2960.33 1900.00 3420.00 Press any key to continue . . . Can anyone help me? Converting Fahrenheit To Celsius
Simple C++ program to convert temperature from either Fahrenheit to Celsius or vise-versa.
tempCon.cpp
Dev C++ Fahrenheit To Celsius Converter Celsiuscommented Mar 13, 2016Fahrenheit To Celsius
commented Mar 3, 2017
commented Mar 7, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |