-
Lenguaje
C
-
Descripción
Calcular el área de un rombo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
float area, diagonal_mayor, diagonal_menor;
printf ("Ingresa el valor de diagonal mayor: ");
scanf ("%f", &diagonal_mayor);
(void) getchar ();
printf ("Ingresa el valor de diagonal menor: ");
scanf ("%f", &diagonal_menor);
(void) getchar ();
area=diagonal_mayor*diagonal_menor/2;
printf ("Valor de area: %g\n", area);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}
#include <stdlib.h>
int main (void)
{
float area, diagonal_mayor, diagonal_menor;
printf ("Ingresa el valor de diagonal mayor: ");
scanf ("%f", &diagonal_mayor);
(void) getchar ();
printf ("Ingresa el valor de diagonal menor: ");
scanf ("%f", &diagonal_menor);
(void) getchar ();
area=diagonal_mayor*diagonal_menor/2;
printf ("Valor de area: %g\n", area);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}