Muammo: problem'ni dasturini tuzib bera oladi.
Despite He or she knows how to code
Despite He or she knows how to code
// Problem
float a, b, orta;
cout<<"Enter two numbers: ";
cin>>a>>b;
orta = (a+b)/2;
cout<<"Average of these numbers: "<<orta;
float a, b, orta;
cout<<"Enter two numbers: ";
cin>>a>>b;
orta = (a+b)/2;
cout<<"Average of these numbers: "<<orta;
// <------------Math---------->
// daraja, ildiz, modul
// pow -> power - daraja
int side, area;
cout<<"Enter the side of the square: ";
cin>>side;
area = pow(side, 2);
cout<<"Area is : "<<area;
// daraja, ildiz, modul
// pow -> power - daraja
int side, area;
cout<<"Enter the side of the square: ";
cin>>side;
area = pow(side, 2);
cout<<"Area is : "<<area;
//endl - endline - qatorning tugashi
int a, V, S;
cout<<"Enter the side of cube: ";
cin>>a;
V = pow(a, 3);
S = 6*pow(a,2);
cout<<"Hajm: "<<V<<endl;
cout<<"To'la sirt: "<<S;
int a, V, S;
cout<<"Enter the side of cube: ";
cin>>a;
V = pow(a, 3);
S = 6*pow(a,2);
cout<<"Hajm: "<<V<<endl;
cout<<"To'la sirt: "<<S;
// kvadrat ildiz - square root
float a, ildiz;
cin>>a;
ildiz = sqrt(a);
cout<<ildiz;
float a, ildiz;
cin>>a;
ildiz = sqrt(a);
cout<<ildiz;
// modul - absolyut qiymat - absolute
// int a, modula;
// cin>>a;
// modula = abs(a);
// cout<<modula<<endl;
// int a, modula;
// cin>>a;
// modula = abs(a);
// cout<<modula<<endl;
// begin 11
int a, b, yig, kop, ma, mb;
cin >> a >> b;
yig = a + b;
kop = a * b;
ma = abs(a);
mb = abs(b);
cout<<yig<<endl;
cout<<kop<<endl;
cout<<ma<<endl;
cout<<mb<<endl;
int a, b, yig, kop, ma, mb;
cin >> a >> b;
yig = a + b;
kop = a * b;
ma = abs(a);
mb = abs(b);
cout<<yig<<endl;
cout<<kop<<endl;
cout<<ma<<endl;
cout<<mb<<endl;
// Integer - butun
// sm bor. nechta to'liq metr?
// 123 sm - 1 ta metr
// Butun bo'lish -> /
// Qoldiq -> %
// a va b; 23 va 7
int a, b, butun, qoldiq;
cout<<"Ikkita son kiriting: ";
cin>>a>>b;
butun = a/b;
qoldiq = a%b;
cout<<"Butun: "<<butun<<endl;
cout<<"Qoldiq: "<<qoldiq<<endl;
// sm bor. nechta to'liq metr?
// 123 sm - 1 ta metr
// Butun bo'lish -> /
// Qoldiq -> %
// a va b; 23 va 7
int a, b, butun, qoldiq;
cout<<"Ikkita son kiriting: ";
cin>>a>>b;
butun = a/b;
qoldiq = a%b;
cout<<"Butun: "<<butun<<endl;
cout<<"Qoldiq: "<<qoldiq<<endl;