|
1- amaliy ish o`lchami X bo`lgan qubik berilgan. Uning hajmini toping
|
Sana | 14.12.2023 | Hajmi | 1,37 Mb. | | #118518 |
Bog'liq Amaliy ish 1 Ahmedov T
PO`CHTA ALOQA TEXNOLOGIYASI S962-22-GURUH TALABASI AHMEDOV TEMUR
DASTURLASH 1 FANIDAN
1- AMALIY ISH
O`lchami x bo`lgan qubik berilgan. Uning hajmini toping.
#include
#include
int main() {
// Foydalanuvchidan qubik o'lchamini olish
double x;
std::cout << "Qubikning o'lchamini kiriting (x): ";
std::cin >> x;
// Qubikning hajmini hisoblash
double hajm = std::pow(x, 3);
// Natijani chiqarish
std::cout << "Qubikning hajmi: " << hajm << std::endl;
return 0;
}
Radyuslarir1,r2,r3bolgan3 ta doiraradyuslariberilgan.Doiralarniyuzinihisoblang.
#include
#include
int main() {
const double PI = 3.14159;
// Foydalanuvchidan 3 ta doira radyuslarini olish
double r1, r2, r3;
std::cout << "1-chi doira radyusini kiriting (r1): ";
std::cin >> r1;
std::cout << "2-chi doira radyusini kiriting (r2): ";
std::cin >> r2;
std::cout << "3-chi doira radyusini kiriting (r3): ";
std::cin >> r3;
// Doiralar yuzini hisoblash
double s1 = PI * std::pow(r1, 2);
double s2 = PI * std::pow(r2, 2);
double s3 = PI * std::pow(r3, 2);
// Yuzlarni qo'shish
double jamiYuz = s1 + s2 + s3;
// Natijani chiqarish
std::cout << "1-chi doira yuzi: " << s1 << std::endl;
std::cout << "2-chi doira yuzi: " << s2 << std::endl;
std::cout << "3-chi doira yuzi: " << s3 << std::endl;
std::cout << "Jami doiralar yuzi: " << jamiYuz << std::endl;
return 0;
}
Yuzasisvabalandligihbo`lganuchburchagberilgan.Uniasosinitoping.
#include
#include
int main() {
const double SQRT3 = sqrt(3.0);
// Foydalanuvchidan uchburchakning yuzasini (S) va balandligini (h) olish
double S, h;
std::cout << "Uchburchakning yuzasini kiriting (S): ";
std::cin >> S;
std::cout << "Uchburchakning balandligini kiriting (h): ";
std::cin >> h;
// Uchburchakning asosini hisoblash
double a = 2 * sqrt(S / (SQRT3 * h));
// Natijani chiqarish
std::cout << "Uchburchakning asosi: " << a << std::endl;
return 0;
}
Radyusi r bo`lgan sharing yuzini toping.
#include
#include
int main() {
const double PI = 3.14159;
// Foydalanuvchidan sharingning radyusini olish
double r;
std::cout << "Sharingning radyusini kiriting (r): ";
std::cin >> r;
// Sharingning yuzasini hisoblash
double S = PI * std::pow(r, 2);
// Natijani chiqarish
std::cout << "Sharingning yuzasi: " << S << std::endl;
return 0;
}
a,b va c tamonli uch burchag berilgan. Uch burchagning pirimetiri topilsin.
#include
int main() {
// Foydalanuvchidan uchburchakning tomonlarini olish
double a, b, c;
std::cout << "Uchburchakning a tomonini kiriting: ";
std::cin >> a;
std::cout << "Uchburchakning b tomonini kiriting: ";
std::cin >> b;
std::cout << "Uchburchakning c tomonini kiriting: ";
std::cin >> c;
// Uchburchakning perimetri
double P = a + b + c;
// Natijani chiqarish
std::cout << "Uchburchakning perimetri: " << P << std::endl;
return 0;
}
Asoslari a va b, balandligi h bo`lgan g`ola yuzini toping.
#include
int main() {
// Foydalanuvchidan g'ola asoslari a, b va balandligi h olish
double a, b, h;
std::cout << "G'ola asosini kiriting (a): ";
std::cin >> a;
std::cout << "G'ola asosini kiriting (b): ";
std::cin >> b;
std::cout << "G'ola balandligini kiriting (h): ";
std::cin >> h;
// G'ola yuzasini hisoblash
double S = 0.5 * a * b * h;
// Natijani chiqarish
std::cout << "G'ola yuzasi: " << S << std::endl;
return 0;
}
Qo`nisning balandligi h va radyusi r bo`lsa uning hajmi nimaga teng bo`ladi.
#include
#include
int main() {
const double PI = 3.14159;
// Foydalanuvchidan qo'nisning balandligi (h) va radyusini (r) olish
double h, r;
std::cout << "Qo'nisning balandligini kiriting (h): ";
std::cin >> h;
std::cout << "Qo'nisning radyusini kiriting (r): ";
std::cin >> r;
// Qo'nisning hajmini hisoblash
double V = (1.0 / 3) * PI * std::pow(r, 2) * h;
// Natijani chiqarish
std::cout << "Qo'nisning hajmi: " << V << std::endl;
return 0;
}
Tezligi v bo`lgan avtomabil s masofani qancha vaqtda bosib o`tadi.
#include
int main() {
// Foydalanuvchidan avtomobilning tezligi (v) va bosilish masofasini (s) olish
double v, s;
std::cout << "Avtomobilning tezligini kiriting (v): ";
std::cin >> v;
std::cout << "Bosilish masofasini kiriting (s): ";
std::cin >> s;
// Bosilish vaqtini hisoblash
double t = s / v;
// Natijani chiqarish
std::cout << "Bosilish vaqti: " << t << " soat" << std::endl;
return 0;
}
h balandlikqan erkin tushayotgan jism qancha vaqtdan keyin erga uriladi.
#include
#include
int main() {
const double g = 9.8; // Yer tilining erga urish tezligi (m/s^2)
// Foydalanuvchidan jismin balandligini (h) olish
double h;
std::cout << "Jismin balandligini kiriting (h): ";
std::cin >> h;
// Jismin erga urilish vaqtini hisoblash
double t = std::sqrt((2 * h) / g);
// Natijani chiqarish
std::cout << "Jismin erga urilish vaqti: " << t << " sekund" << std::endl;
return 0;
}
Jo`mrakdan 1 s da 1 milli litr suv tomsa x yilda necha litr suv tomadi.
#include
#include
int main() {
const double g = 9.8; // Yer tilining erga urish tezligi (m/s^2)
// Foydalanuvchidan jismin balandligini (h) olish
double h;
std::cout << "Jismin balandligini kiriting (h): ";
std::cin >> h;
// Jismin erga urilish vaqtini hisoblash
double t = std::sqrt((2 * h) / g);
// Natijani chiqarish
std::cout << "Jismin erga urilish vaqti: " << t << " sekund" << std::endl;
return 0;
}
A,B,C sonlar berilgan A ning qiymati B ga, B ning qiymati C ga, C ning aiymati A ga almashtirilsin.
#include
int main() {
// Uchta butun son olish
int A, B, C;
std::cout << "A ni kiriting: ";
std::cin >> A;
std::cout << "B ni kiriting: ";
std::cin >> B;
std::cout << "C ni kiriting: ";
std::cin >> C;
// Almashish
int temp = A;
A = B;
B = C;
C = temp;
// Natijani chiqarish
std::cout << "Almashishdan so'ng:\n";
std::cout << "A = " << A << "\n";
std::cout << "B = " << B << "\n";
std::cout << "C = " << C << "\n";
return 0;
}
Massasi m bo`lgan jismni og`irligini toping.
#include
int main() {
const double g = 9.8; // Yer tilining erga urish tezligi (m/s^2)
// Foydalanuvchidan jism massasini olish
double m;
std::cout << "Jism massasini kiriting (kg): ";
std::cin >> m;
// Jismning og'irligini hisoblash
double W = m * g;
// Natijani chiqarish
std::cout << "Jismning og'irligi: " << W << " N (Nyuton)\n";
return 0;
}
m massali jismga a tezlanish berilganda unga qanchali kuch tasir qiladi.
#include
int main() {
// Foydalanuvchidan jism massasini (m) va tezlanishni (a) olish
double m, a;
std::cout << "Jism massasini kiriting (kg): ";
std::cin >> m;
std::cout << "Jism tezlanishini kiriting (m/s^2): ";
std::cin >> a;
// Kuchni hisoblash
double F = m * a;
// Natijani chiqarish
std::cout << "Jismga qo'yilgan kuch: " << F << " N (Nyuton)\n";
return 0;
}
Tomoni a bo’lgan kvadrat berilgan uning peremetrini aniqlang.
#include
int main() {
// Foydalanuvchidan kvadratning tomonini (a) olish
double a;
std::cout << "Kvadratning tomonini kiriting: ";
std::cin >> a;
// Kvadratning perimetri
double P = 4 * a;
// Natijani chiqarish
std::cout << "Kvadratning perimetri: " << P << std::endl;
return 0;
}
Tekislikda berilgan (x1,y1) va (x2,y2) nuqtalar orasidagi masofani toping.
#include
#include
int main() {
// Foydalanuvchidan nuqtalar koordinatalarini olish
double x1, y1, x2, y2;
std::cout << "Birinchi nuqta koordinatalarini kiriting (x1 y1): ";
std::cin >> x1 >> y1;
std::cout << "Ikkinchi nuqta koordinatalarini kiriting (x2 y2): ";
std::cin >> x2 >> y2;
// Ular orasidagi masofani hisoblash
double distance = std::sqrt(std::pow(x2 - x1, 2) + std::pow(y2 - y1, 2));
// Natijani chiqarish
std::cout << "Ular orasidagi masofa: " << distance << std::endl;
return 0;
}
|
| |