Ma’lumotlar tuzilmasi va algoritmi F.I.SH._Saparboyeva Mahliyo Guruh: 912-22 Amaliyot: 2 Misol: 19 Dasturlash tili: c++ Savol: Berilgan a va b sonlarining EKUB ini topuvchi funksiya yarating.
#include int EKUB(int a, int b) { while (b != 0) { int temp = b; b = a % b; a = temp; } return a; } int main() { int a, b; std::cout << "a ni kiriting: "; std::cin >> a; std::cout << "b ni kiriting: "; std::cin >> b; int ekub = EKUB(a, b); std::cout << "EKUB(" << a << ", " << b << ") = " << ekub << std::endl; return 0; }