uchburchakning yuzasi topuvchi funksiya

DOCX 2 pages 243.1 KB Free download

Page preview (2 pages)

Scroll down 👇
1 / 2
914-guruh talabasi ravshanqulov mirjalol dasturlash1 5-amaliy ishi mavzu: funksiyalar. qiymat qaytradigan va qiymat qaytarmaydigan funksiyalar. rekursiv funksiyalar. 11.uchburchakni uchta uchining koordinatalari berilgan. uning yuzasini topuvchi funksiya tuzing. #include #include struct point { double x, y; }; double findtrianglearea(const point& p1, const point& p2, const point& p3) { // uchburchak yuzasini topish uchun heron formulasi double a = std::sqrt(std::pow(p2.x - p1.x, 2) + std::pow(p2.y - p1.y, 2)); double b = std::sqrt(std::pow(p3.x - p2.x, 2) + std::pow(p3.y - p2.y, 2)); double c = std::sqrt(std::pow(p1.x - p3.x, 2) + std::pow(p1.y - p3.y, 2)); // uchburchak yuzasi double s = (a + b + c) / 2; return std::sqrt(s * (s - a) * (s - b) * (s - c)); } int main() { // uchburchak uchun nuqtalar point p1, p2, p3; std::cout > p1.x >> p1.y; std::cout > p2.x >> p2.y; std::cout > p3.x >> p3.y; // uchburchak yuzasini topish double area …
2 / 2
uchburchakning yuzasi topuvchi funksiya - Page 2

Want to read more?

Download all 2 pages for free via Telegram.

Download full file

About "uchburchakning yuzasi topuvchi funksiya"

914-guruh talabasi ravshanqulov mirjalol dasturlash1 5-amaliy ishi mavzu: funksiyalar. qiymat qaytradigan va qiymat qaytarmaydigan funksiyalar. rekursiv funksiyalar. 11.uchburchakni uchta uchining koordinatalari berilgan. uning yuzasini topuvchi funksiya tuzing. #include #include struct point { double x, y; }; double findtrianglearea(const point& p1, const point& p2, const point& p3) { // uchburchak yuzasini topish uchun heron formulasi double a = std::sqrt(std::pow(p2.x - p1.x, 2) + std::pow(p2.y - p1.y, 2)); double b = std::sqrt(std::pow(p3.x - p2.x, 2) + std::pow(p3.y - p2.y, 2)); double c = std::sqrt(std::pow(p1.x - p3.x, 2) + std::pow(p1.y - p3.y, 2)); // uchburchak yuzasi double s = (a + b + c) / 2; return std::sqrt(s * (s - a) * (s - b) * (s - c)); } int main() …

This file contains 2 pages in DOCX format (243.1 KB). To download "uchburchakning yuzasi topuvchi funksiya", click the Telegram button on the left.

Tags: uchburchakning yuzasi topuvchi … DOCX 2 pages Free download Telegram