F=100; calculate C C=212 calculate F C=32 calculate F lnopreare the methods inco
ID: 3806643 • Letter: F
Question
F=100; calculate C
C=212 calculate F
C=32 calculate F
Explanation / Answer
Here what code to use for application development is not specified so I am using C code
a)
#include<stdio.h>
int main(void)
{
int fahrenheit = 100 ;
double celsius;
celsius = (5.0/9.0)*(fahrenheit-32);
printf("celcius termperature is: %1f",celsius);
}
b)
#include<stdio.h>
int main(void)
{
int celsius = 212 ;
double fahrenheit;
fahrenheit = (9.0/5.0)*(celsius+32);
printf("fahrenheit termperature is: %1f",fahrenheit);
}
c)
#include<stdio.h>
int main(void)
{
int inputtemp ;
double outputtemp;
int a;
printf("enter the temperature you want to convert/n");
scanf("%d",&inputtemp);
printf("if you want to change into fahrenheit enter 0 or 1 to convert into celsius");
scanf("%d",&a);
if(a==0)
{
outputtemp = (9.0/5.0)*(inputtemp+32);
printf("fahrenheit termperature is: %1f",outputtemp);
}
else
{
outputtemp = (5.0/9.0)*(inputtemp-32);
printf("celcius termperature is: %1f",outputtemp);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.