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)
- arning 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_forwardHelp me on below python program.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
- Q3: Write aC program to find the value of X in the equation below for any entered real numbers (A and B). ba X = A50 + Barrow_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
- The unit of convection current density is * O Ampere per Meter O Ampere O Volt per Meter O Ampere per Square Meterarrow_forwarda) Write an appropriate Python arithmetic expression for each of the following: thropood 1. A = (a – b) × (b - c) x (c - a) 2. S = (2A – 2B) + C2 -b+b2-4ac 2a 3. Root = oot M .%0 والتك العربية للعلوم و gineering 4. B = P(1 + )Domyal bo boarrow_forwardPhytonarrow_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