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