Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  yt
Language: C/C++
Code:
#include<stdio.h>
int main(void)
{
    int n,cont= 1;
    float x,media,suma=0;
    /*inicializar y leer el valor de n*/
    printf("cuantos numeros deseas leer?");
    scanf("%d",&n);
    while(cont<=n){
                   printf("x=");
                   scanf("%f",&x);
                   suma +=x;
                   ++cont;
                   }
                   media=suma/n;
                   printf("nLa media es%fn",media);
                   getchar();
                   getchar();
                   getchar();
                   return 0;
                   }
          
Comments: