Mediaaritmetica

Page 1

#include<conio.h> #include<stdio.h> #include<windows.h> main() { int n,i; float xi,suma,ma; clrscr(); printf("media aritmetica\n"); printf("ingrese el limite\n"); scanf("%d",&n); i=1;suma=0; while(i<=n) { printf("ingrese el elemento%d",i); scanf("%f",&xi); suma=suma+xi; i=i+1; } ma=suma/n; printf("la ma es %22f",ma); system("pause"); }


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.