Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  teste.c
Language: C/C++
Code:
#include <stdio.h>

typedef struct{
     float base;
     float altura;
}triangulo;

float area_triangulo(triangulo a){
     float area;
     area = a.base * a.altura / 2;
     return area;
}

int main(){
     triangulo enter;
     scanf("%f %f", &enter.base, &enter.altura);
     float valor_area = area_triangulo(enter);
     printf("%f", valor_area);
     
     return 0;
}     
          
Comments: