#include <stdio.h>

int main() {
    float frente, fondo, costo_m2;
    float area, precio_total;

    // Solicitar datos al usuario 
    printf("==CALCULADORA DE TERRENOS===\n");
    printf("Ingresa los metros de frente: ");
    scanf("%f",&frente);

    printf("ingresa los metros de fondo: ");
    scanf("%f",&fondo_m2);

    printf("ingresa el costo por metro cuadrado: $");
    scanf("%f", &costo_m2);

    //calcular área y precio 
    area = frente * fondo;
    precio_total = area * costo_m2;

    //mostrar resultados 

    printf("\n--- resultado ---\n");
    printf("area del terreno: %.2f m2\n", area);
    printf("precio total a pagar:.$%.2f\n", precio_total);

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: