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 | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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); }

23rd Aug 2021, 2:43 PM
Cabañas Aylin
Cabañas Aylin - avatar
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!
23rd Aug 2021, 2:46 PM
Lothar
Lothar - avatar
+ 1
U need an array, not only the sum
23rd Aug 2021, 3:00 PM
Oma Falk
Oma Falk - avatar