For Better Performance Please Use Chrome or Firefox Web Browser

8-2

#include<iostream.h>

void main ()
{

	int tedad = 0, tedadKoll;
	double nomre, majmoo=0, miyangin;

	cout << "tedad daaneshjoohaa? ";
	cin >> tedadKoll;

	while (tedad < tedadKoll) {
		// barraye har daaneshjoo, nomre
		//bepors, jam raa hessab kon
		tedad++;
		cout << "nomreye # " << tedad << " vared konid:";
		cin >> nomre;
		majmoo += nomre;
	}

	miyangin = majmoo / tedad;
	cout << "tedad=" << tedad 
		<< " miyangin=" << miyangin << endl;
}

تحت نظارت وف ایرانی