Computer Science, asked by charanjeet71234, 6 months ago


The science teacher has asked you to create a program in Small Basic that will convert a given

Fahrenheit value to Celsius. Can you do the same task?

Hint: Celsius = 5/9 (Fahrenheit - 32)​

Answers

Answered by parardhadhar2005
0

Answer:

I have given the codings of different computer languages you can choose your one

Explanation:

JAVA

import java.util.Scanner;

public class Fahrenheit_Celsius  

{

   public static void main(String[] args)  

   {

       double celsius, fahrenheit;

       Scanner s = new Scanner(System.in);

       System.out.print("Enter temperature in Fahrenheit:");

       fahrenheit = s.nextDouble();

       celsius = (fahrenheit-32)*(0.5556);

       System.out.println("Temperature in Celsius:"+celsius);        

   }

}

C++

#include<iostream>

using namespace std;

main() {

  float f, c;

  cout << "Enter temperature in Celsius: ";

  cin >> c;

  f = (9.0*c/5.0)+32;

  cout << "Equivalent Fahrenheit temperature is: " << f;

}

c

#include<stdio.h> // include stdio.h

int main()  

{

   float fah, cel;

   printf("Enter a temp in fah: ");

   scanf("%f", &fah);

   cel = (5.0/9) * (fah - 32);

   printf("%.2f°F is same as %.2f°C", fah, cel);

   return 0;

}

Python

# Temprature in celsius degree  

celsius = 40

# Converting the temprature to  

# fehrenheit using the above  

# mentioned formula  

fahrenheit = (celsius * 1.8) + 32

# printing the result  

print('%.2f Celsius is equivalent to: %.2f Fahrenheit'

%(celsius, fahrenheit))  

If you have understood than good

but if not

Pls post the doubt

And mark me brainliest if you like it.

Thanks

Similar questions