Concept explainers
Write a
C F
Explanation of Solution
Program:
The following program demonstrate the conversion of Fahrenheit into Celsius.
//include the header file
#include <stdio.h>
//definition of main method
int main (void)
{
//declare the required variables
float F, C;
//get the input from the user
printf (" Enter the temperature value in Fahrenheit: ");
scanf("%f", &F);
//convert Fahrenheit into Celsius
C = (F - 32) / 1.8;
//display the result
printf (" The Celsius: %f\n", C);
//return statement
return 0;
}
Explanation:
In the above program, declare the required header file. Inside the main method, get the temperature from the user then convert Fahrenheit into Celsius using given formula. Finally display the output.
Enter the temperature value in Fahrenheit: 27
The Celsius: -2.777778
Want to see more full solutions like this?
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with Python (4th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Database Concepts (8th Edition)
- Q1/an A-Write a program to compute the drag force F, (in Newton) When a body swims through fluid, the drag force is given by 1 F =PV ²ACD Take Matlab p= 1000 kg/m3 is the density of fluid, V = 1.25 (m/s) is the swimming speed, A=0.25 m² is the frontal area of the body, Cp=0.09 is the coefficient of dragarrow_forwardThe difference between two numbers is 15. If one number is represented by x, the other number can be expressed as whatarrow_forwardHelp me on below python program.arrow_forward
- Write simple python code as i am a begineerarrow_forward(General math) The value of p can be approximated by this series: 4(113+1517+....) Using this formula, write a program that calculates and displays the value of , using 2, 3, and 4 terms of the series.arrow_forwardIf the following code segment compiles correctly, what do you know about the variable x? if(x) WriteLine(OK); a. x is an integer variable. b. x is a Boolean variable. c. x is greater than 0. d. none of thesearrow_forward
- Find the error(s) in the following code: (6)arrow_forwardWrite a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Display both values to one decimal place.arrow_forwardWrite a pseudo code for calculating the profit for a company that generates 50% of total sales. Based on that percentage, generate the prediction of the profit for the company sale amount is $7.5million in the current year. Also give three dry runs for the above pseudocode.arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning