<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

Ikki nuqta orasidagi masofani topish uchun menga C++ da funksiya yozing<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Mana C ++ funksiyasining 2-o'lchamli fazodagi ikkita nuqta o'rtasidagi masofani hisoblash uchun misoli: #include <cmath> double distance ((double x1, double y1, double x2, double y2) { return sqrt ((pow ((x2 - x1, 2) + pow ((y2 - y1, 2)); } Ushbu misolda masofani hisoblash funksiyasi to'rtta argumentni oladi: ikkita nuqtaning x va y koordinatalari. Funksiya Pifagor teoremasidan foydalanib, ushbu ikkita nuqta o'rtasidagi Evklid masofani hisoblaydi va natijani ikki baravar qiymat sifatida qaytaradi.<|eot_id|>