Bajardi: Ulug’murodov. D
Download 322.42 Kb.
|
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< } Bu yerda (#include (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="< } 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"< } 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="< } 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="< } 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="< } 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
ma'muriyatiga murojaat qiling