Oscar Galvan

Generation

generate functionWed, 05 Apr 2023

Escribir un algoritmo que lea N números enteros y obtenga su promedio.

int main(int argc, char const *argv[]) { int N = 0, suma = 0, num = 0; float promedio = 0; printf("Ingrese el valor de N: "); scanf("%d", &N); for(int i = 0; i < N; i++) { printf("Ingrese el valor del numero: "); scanf("%d", &num); suma += num; } promedio = suma/N; printf("El promedio de los numeros es: %f\n", promedio); return 0;

Want to kickstart your project?Use the new AI Studio to create your code