Search This Blog

Monday, 7 March 2022

Practical No.9: Write a program to convert temperature from Fahrenheit into Celsius

ACTIVITY 9

Practical No.9:
Write a program to convert temperature from Fahrenheit into Celsius






OR

By Sir Sajjad Akber Chandio

ALGORITHM

  • step 1: start
  • step 2: Declare variables or Fahrenheit and Celsius
  • step 3: Take input for temperature in Fahrenheit
  • step 4: Convert Fahrenheit into Celsius by using formula i.e. (F – 32) * (5.0 / 9.0)
  • step 5: Print temperature value in Celsius
  • step 6: End


VIVA VOCE
ACTIVITY 9

Q.1: Define the range of Fahrenheit scale.
Ans: Fahrenheit scale is marked from 32° to 212°.

Q.2: Write down the formula of Fahrenheit into centigrade.
Ans: Fahrenheit into Celsius conversion is done by this formula:
Celsius = (Fahrenheit -32) * (5.0 / 9.0)

Q.3: Write down the formula of Celsius into Fahrenheit.
Ans: Fahrenheit into Celsius conversion is done by this formula:
Fahrenheit = {Celsius * (5.0 / 9.0)} + 32

Q.4: Define the range of Celsius scale.
Ans: Celsius scale is marked from 0° to 100°.

Q.5: What is the purpose of return keyword used in C++?
Ans: This statement is used to return the value to the operating system. By default, main function returns integer value 0.



No comments:

Post a Comment