Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
bartleby

Concept explainers

bartleby

Videos

Textbook Question
100%
Book Icon
Chapter 3, Problem 4E

Write a program that converts 27® from degrees Fahrenheit (F) to degrees Celsius (C) using the following formula:

C F

Expert Solution & Answer
Check Mark

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.

Sample Output

Enter the temperature value in Fahrenheit:  27

The Celsius: -2.777778

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
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: 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 drag. Matlap
The Harris-Benedict equation estimates the number of calories your body needs to maintainyour weight if you do no exercise. This is called your basal metabolic rate, or BMR.The formula for the calories needed for a woman to maintain her weight isBMR = 655 + (4.3 x weight in pounds) + (4.7 x height in inches) -(4.7 x age in years)The formula for the calories needed for a man to maintain his weight isBMR = 66 + (6.3 x weight in pounds) + (12.9 x height in inches) -(6.8 x age in years)A typical chocolate bar will contain around 230 calories. Write a program that allows the userto input his or her weight in pounds, height in inches, age in years, and the character M formale and F for female. The program should then output the number of chocolate bars thatshould be consumed to maintain one's weight for the appropriate sex of the specified weight,height, and age.
Q1/A-Write a program to compute the mass flow rate of a fluid (in kg/sec) through a thermal unit according to the following equation: K AMPO RTO m² (K + 1) 2M²](K+1)/(2(K+1)] where: QBasic A=0.25 m² is the area M=2.0 Mach number of the fluid flow Po=200.0 kPa is the pressure of the fluid K = 1.4 is the ratio of specific heats of fluid R=0.287 kJ/(kg-K) is the gas constant To 300 K is the temperature of the fluid

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY