2 ta sonnning o’rta arifmetigi va o’rta geometrigini hisoblovchi dastur funksiya hosil qiling


Download 15.65 Kb.
Sana13.12.2020
Hajmi15.65 Kb.
#165611
Bog'liq
DIF 5-labaratoriya ishi


  1. 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;

Download 15.65 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling