#include < iostream.h >
#include < stdlib.h >
#include < math.h >
main ( )
{
long double sayi;
long int sayi_sayac= 0;
double en_buyuk;
double en_kucuk;
long double toplam= 0;
long double carpim= 1;
cout << "\n\nSayi girin: ";
cin >> sayi ;
en_kucuk = sayi;
en_buyuk = sayi;
for ( ; ; )
{
system ( " cls " );
sayi_sayac++;
cout << "\n\nGirilen sayi adedi: " << sayi_sayac << endl;
//cout << "_____ " << endl;
toplam = toplam + sayi;
cout << "Girilen sayilarin toplami: " << toplam << endl;
//cout << "_____ " << endl;
carpim *= sayi;
cout << "Girilen sayilarin carpimi: " << carpim << endl;
//cout << "_____ " << endl;
cout << "Girilen sayilarin aritmetik ortalamasi: " << ( toplam / sayi_sayac ) << endl;
//cout << "_____ " << endl;
if ( sayi_sayac > 1 )
{
cout << "Girilen sayilarin geometrik ortalamasi: " << ( sqrt ( carpim ) ) << endl;
//cout << "_____ " << endl;
}
if ( sayi <= en_buyuk)
{
cout << "Girilen sayilarin en buyugu: " << en_buyuk << endl;
}
if ( sayi > en_buyuk)
{
en_buyuk = sayi;
cout << "Girilen sayilarin en buyugu: " << en_buyuk << endl;
}
if ( sayi >= en_kucuk )
{
cout << "Girilen sayilarin en kucugu: " << en_kucuk <<endl;
}
if( sayi < en_kucuk )
{
en_kucuk = sayi;
cout << "Girilen sayilarin en kucugu: " << en_kucuk <<endl;
}
cout << "\n\nSayi girin: ";
cin >> sayi;
}
system ( " pause " );
return 0;
}
// ender yılmaz -> endrylmz@mynet.com
gauss
endrylmz@mynet.com