Minggu, 23 November 2025

ex1005.c fahrenheit ke celcius

/* ex1005.c */
#include <stdio.h>

float convert(float f);
int main()
{
    float temp_f,temp_c;
    printf("Temperatur di Fahrenheit: ");
    scanf("%f",&temp_f);
    temp_c=convert(temp_f);
    printf("%.1fF adalah %.1fC\n",temp_f,temp_c);
    return(0);
}

float convert(float f)
{
    float a;
    a=(f-32)/1.8;
    return(a);
}

output:
 
Temperatur di Fahrenheit: 132
132.0F adalah 55.6C

Process returned 0 (0x0)   execution time : 5.134 s
Press any key to continue.

Tidak ada komentar:

Posting Komentar