C=(F-32)*5/9. Input Fahrenheit degree.
//AREA OF CIRCLE
#include <stdio.h>
#include <math.h>
int main()
{
float radius, area;
printf("Enter the radius of a circle\n");
scanf("%f", &radius);
area = 3.14*radius*radius;
printf("Area of the circle = %.2f\n", area);
return 0;
}
// AREA OF RECTANGLE
#include<stdio.h>
#include<conio.h>
int main() {
int length, width, area;
printf("\nEnter the Length of Rectangle : ");
scanf("%d", &length);
printf("\nEnter the Widthof Rectangle : ");
scanf("%d", &width);
area = length * width;
printf("\nArea of Rectangle : %d", area);
return (0);
}
// Celsius to Fahrenheit
#include <stdio.h>
int main()
{
float celsius, fahrenheit;
printf("Enter temperature in Celsius: ");
scanf("%f", &celsius);
fahrenheit = (celsius * 9 / 5) + 32;
printf("%.2f Celsius = %.2f Fahrenheit", celsius, fahrenheit);
return 0;
}
// Fahrenheit to Celsius
#include<stdio.h>
int main()
{
float fahrenheit, celsius ;
printf("Enter a temp in fahrenheit: ");
scanf("%f", &fahrenheit);
celsius = (fahrenheit- 32)*(5.0/9);
printf("%.2f°F is same as %.2f°C", fahrenheit, celsius );
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.