C++ dagi 6-dars

abrorabdulboriyev

AbrorAbdulboriyev

Posted on November 15, 2022

C++ dagi 6-dars

C++ Matematik Funksiyalar

Assalomu Alaykum bugun siz bilan bir qancha imkoniyatlarga ega funksiyalar haqida ma'lumotga ega bo'lamiz. Bugun siz bilan matematik funksiyalar haqida gaplashamiz. C++ dasturlash tilida raqamlarda matematik vazifalarni bajarish imkoniyatini beradigan ko'pgina funksiyalar mavjud.

MIN va MAX

Funktsiya eng yuqori qiymatini topish uchun foydalanish mumkin X va y :max(x,y)

cout << max(13, 15);
Enter fullscreen mode Exit fullscreen mode

Va funktsiya x va y ning eng past qiymatini topish uchun ishlatilishi mumkin :min(x,y)

cout << min(5, 10);
Enter fullscreen mode Exit fullscreen mode

C ++ <cmath> Kutubxonasi.

sqrt(Kvadrat ildiz), round(sonni aylantiradi) va log (natural logarifm) kabi boshqa funktsiyalarni <cmath> kutubxonasida topish mumkin :

#include <iostream>
#include <cmath>
using namespace std;

int main() {
  cout << sqrt(64) << "\n";
  cout << round(2.6) << "\n";
  cout << log(2) << "\n";
  return 0;
}
8
3
0.693147
Enter fullscreen mode Exit fullscreen mode

Boshqa matematik vazifalar.

Boshqa Math funktsiyalari ( <cmath>kutubxonasida) ro'yxatini quyidagi jadvalda topish mumkin:

Image description

Bugungi mazular shulardan iborat edi hozircha shu mavzular haqida gaplashgan bo'ldik lekin kuzatishda to'xtatmang ko'rushguncha hurmatli Bo'lajak Dasturchilar. 🖐️🖐️

@dawroun

💖 💪 🙅 🚩
abrorabdulboriyev
AbrorAbdulboriyev

Posted on November 15, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

while, do-while and for loops in C++
beginners while, do-while and for loops in C++

March 7, 2024

If statements in C++
beginners If statements in C++

March 4, 2024

Operators and true folse .
beginners Operators and true folse .

March 14, 2023