0
help me make a program to read the ages of a group of 10 children, take the average and how many children are over 10 years old
Es mi intento... //Programa para leer las edades de un grupo de 10 niños #include <stdio.h> int main() { int i, edades, a; i = 10; float p; printf("PROMEDIO DE EDADES DEL GRUPO"); for (i = 1; i <= 10; i++) { printf("\n Introduce la edad del alumno %d", i); scanf("%d", &edades); a = a + edades; } p = (a / 10); printf("\n El promedio de la edad del grupo es de: %f", p); return (0); }
2 Réponses
+ 5
Cabañas Aylin ,
before we can help you, you should show us your attempt first. if you have not done a try by yourself upto now, please do so. Put your code in playground and link it here. Thanks!
+ 1
U need an array, not only the sum