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
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (9th Edition)
Using MIS (10th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting out with Visual C# (4th Edition)
- raph EECP1290: Computer Programming for Engineering Write a program to calculate the K value using if else condition If P value is more than 9 then K = M/2 – vP+C If P value is less than or equal to 9 then K = M/2 + /P +C I= Where C is a constant with value 1.7arrow_forwardAirline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönderarrow_forwardarning Portal Courses Reports e-Services Academic Departments ETC CIMS Write a python program to accept a number and if the number is even calculate Z-y modulus x, by taking x and y input from user If number is positive.calculate Z-y to the powerx, by taking x and y input from user if the number s equal to 0 caculate Z-x to thne powery by tking xand y input from user fnumber is in tetween 1and 10 cakulate 7**y2.by taking and y input from user Otherwise display Invalid input:arrow_forward
- An integer n is divisible by 9 if the sum of its digits is divisible by 9. Develop a program to display each digit, starting with the rightmost digit. Your program should also determine whether or not the number is divisible by 9.arrow_forwardThe difference between two numbers is 15. If one number is represented by x, the other number can be expressed as whatarrow_forwardWrite a program that calculates and prints the volume of a pyramid given the base (b) and the height (h) of the pyramid. The formula to calculate the volume is: Volume = (1/3) *b * h Enter the base of the pyramid: 3 Enter the height of the pyramid: 2 The volume is 1.9998arrow_forward
- Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula: length = v2/2a Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared and displays the minimum runway length.arrow_forwardWrite a program that converts integer Fahrenheit temperatures from 0 to 212 degrees to floating-point Celsius temperatures with 3 digits of precision. Perform the calculation using the formula celsius = 5.0 / 9.0* (fahrenheit - 32);arrow_forwardThe island nation of Babbage charges its citizens an income tax each year. The tax rate is based on the following table: Income $0 - 5000 $5001 - 10000 $10001 - 20000 $20001 40000 Over $40000 Tax Rate 0% 3% 5.5% 10.8% 23.7% Write a program that, when given a person's income, prints the tax owed rounded to the nearest dollar. Enter your income: 35000 Your tax is: $3780arrow_forward
- Given an airplane's acceleration and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula. length=v^2/2*a. write a program that prompts the user to enter V in meters and acceleration an in meter/second and display the minimum runway length.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_forwardWrite a program to calculate the difference between two numbers:arrow_forward
- 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 PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning