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
Write a C line to represent the following equation
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
Land Calculation One acre of land is equivalent to 43,560 square feet. Write a program that calculates the numb...

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Does the Do-While loop test its condition before or after it performs an iteration?

Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)

This operator can be used to determine whether a reference variable references an object of a particular class....

Starting Out with Java: From Control Structures through Objects (6th Edition)

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