Bajardi: Ulug’murodov. D


Download 322.42 Kb.
Sana27.01.2023
Hajmi322.42 Kb.
#1134436
Bog'liq
ulug\'murodov dilshodbek mustaqil ish


Dasturlashdan mustaqil ishlagan misollar


Bajardi:Ulug’murodov. D
Tekshirdi: Normamatov .M

1.C++ tillida ikkita sondan kattasini topuvchi dastur tuzing.


1.Dasturning tuzilishi:
#include

using namespace std;


int main()
{
int a,b,max;
cin>>a;
cin>>b;
max=(a>b) ? a :b;
cout< return 0;
}
Bu yerda (#include) standart kutibhona hisoblanadi.
(int main ()) ishni boshlash. Har doim amallar {} figurali qavs ichida bajariladi.
2. Kubni tomonlari a ga teng shu kubning S yuzasini va V hajmini topuvchi dastur tuzing.
2.Dasturni tuzilishi:
#include
#include
using namespace std;
int main ()
{
int a, S,V;
cout<<"a ni kiriting";cin>>a;
S=6*pow(a,2);
V=pow(a,3);
cout<<"S ni qiymati="< cout<<"V ni qiymati="< return 0;
}
2. Dasturni natijasi:
a ni kiriting2
S ni qiymati=24
V ni qiymati=8
3. Tug’ri burchakli uchburchakning a va b katetlari berilgan.Shu uchburchakni (c) gepatinuzasini va (S) yuzini
topuvchi dastur tuzing.
3.Dastur tuzilishi:
#include
#include
using namespace std;
int main()
{
int a,b,c,S;
cout<<"a ni kiriting";cin>>a;
cout<<"b ni kiriting";cin>>b;
c=sqrt(pow(a,2)+pow(b,2));
S=a*b/2;
cout<<"c ni qiymqti"< cout<<"S ni qiymati"< return 0;
}

4.Ikkita butun sonning urta arfmetigi va urta geometrigini


topuvchi dastur tuzing.
4. Dasturni tuzilishi:
#include
#include
using namespace std;
int main()
{//ikkita butun son berilgan ularning urta arfmetigi va geometrigini toping
float a,b,arf,geo;
cout<<"a ni kiriting a=";cin>>a;
cout<<"b ni kiriting b=";cin>>b;
arf=(a+b)/2;
geo=sqrt(a*b);
cout<<"urta arfmetigi="<cout<<"urta geometrigi="< return 0;
}

5.H balandlikdan erkin tushayotga jismning uchish uzoqligini topuvchi dastur tuzing (g=10 erkin tushish tezlanishi).


5.Dastur tuzilishi:
#include
#include
using namespace std;
int main ()
{
int H,t,g=10;
cout<<"H ni kiriting=";cin>>H;
t=sqrt(H*2/g);
cout<<"t ni qiymati="< return 0;

}

6.Teng tomonli uchburchak berilgan tomonlari a ga teng. Shu uchburchakni S yuzasini topuvchi dastur tuzing.


6. Dastur tuzilishi:
#include
#include
using namespace std;
int main()
{
float a,S;
cout<<"a ni kiriting=";cin>>a;
S=sqrt(3)/4*pow(a,2);
cout<<"S ni qiymati="< return 0;
}
6. Dasturni natijasi:
a ni kiriting=4
S ni qiymati=6.9282


7. L uzunlikdagi matematik mayatnikni tebranish davrini hisob lovchi dastur tuzing.

Download 322.42 Kb.

Do'stlaringiz bilan baham:




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