2 ta sonnning o’rta arifmetigi va o’rta geometrigini hisoblovchi dastur funksiya hosil qiling.
Ushbu funksiya orqali a,b,c,d sonlaridan (a,b) , (a,c), (a,d) juftliklarni o\rta arifmetik va geometrigini hisoblang.
#include
#include
using namespace std;
float arifmetik(int x, int y)
{
return (x+y)/2;
}
float geometrik(int x, int y)
{
return sqrt(x*y);
}
int main()
{
int a,b,c,d;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"c="; cin>>c;
cout<<"d="; cin>>d;
cout<
cout<<"(a,b) o'rta geometrik="< cout<<"t1="; cin>>t1;
cout<<"t2="; cin>>t2;
cout<<"t3="; cin>>t3;
cout<<"endl";
cout<<"Vaqt 1: "< cout<<"Vaqt 2: "< cout<<"Vaqt 3: "< return 0;
Do'stlaringiz bilan baham: |