Object: - Write a program and algorithm for temperature conversion from Fahrenheit temperature to Celsius temperature
Program:-
# include<stdio.h>
#include<conio.h>
void main()
{
float f, c;
clrscr();
printf("Enter the value of farenhiet temprature:");
scanf("%f",&f);
c=5*(f-32)/9 ;
printf("celcious temprature=%f",c);
getch();
}
Algorithm:-
Step (1):- Start
Step (2):- Declare the variable f, c as float type
Step (3):- Value of variable f
Step (4):- c ← 5*(f-32)/9
Step (5):- Write the value of c
Step (6):- Stop
--------------------------------------------------------------------------
Output:-
Enter the value of farenhiet temprature:50
celcious temprature=10.000000
Program:-
# include<stdio.h>
#include<conio.h>
void main()
{
float f, c;
clrscr();
printf("Enter the value of farenhiet temprature:");
scanf("%f",&f);
c=5*(f-32)/9 ;
printf("celcious temprature=%f",c);
getch();
}
Algorithm:-
Step (1):- Start
Step (2):- Declare the variable f, c as float type
Step (3):- Value of variable f
Step (4):- c ← 5*(f-32)/9
Step (5):- Write the value of c
Step (6):- Stop
--------------------------------------------------------------------------
Output:-
Enter the value of farenhiet temprature:50
celcious temprature=10.000000
0 Comments:
Post a Comment