Update PR3

This commit is contained in:
2024-05-22 07:08:12 +02:00
parent 036bb9d949
commit fbaedb6630
3 changed files with 212 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,29 @@
#include <stdio.h>
typedef struct
{
float collect[10];
int position;
} tReal;
void mediaValores(tReal *tabla)
{
float suma = 0;
int i;
for (i = 0; i < tabla->position; i++)
{
suma += tabla->collect[i];
}
printf("La media de los valores de la tabla es: %f\n", suma / tabla->position);
}
int main(int argc, char **argv)
{
tReal tabla = {{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, 10};
mediaValores(&tabla);
return 0;
}