Members Valentin Posted April 4, 2020 Members Posted April 4, 2020 Salutare, #include<iostream> #include<math.h> #include<conio.h> using namespace std; int main () { float MediaAritmetica; int x, nr, suma; suma=0; nr=1; cout<<"Dati numarul x= "; cin>>x; while(x!=0) { suma=suma+x; nr++; cout<<"Dati numarul x= "; cin>>x; } nr--; MediaAritmetica=suma/nr; cout<<"Media aritmetica este egal cu:"<<MediaAritmetica; return 0; _getch(); } 2 Salutare, pentru website-uri PM.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now