dev-resources.site
for different kinds of informations.
Masala
Published at
6/11/2022
Categories
masala
cpp
uzbek
programming
Author
nilufarbukhorova
Main Article
Author
16 person written this
nilufarbukhorova
open
N1-->
Ikki nuqta orasidagi masofani hisoblab beradigan funksiya tuzing.
- nomi:
distance
- parametrlari: int aX, int aY, int bX, int bY
- qaytarishi: shu ikki nuqta orasidagi masofani float sifatida qaytaradi. Answer:
#include <iostream>
#include <cmath>
using namespace std;
float distance(int aX, int aY, int bX, int bY)
{
int a= aY - bY;
int b= aX - bY;
int cKvadrat = a*a + b*b;
int c = sqrt(cKvadrat); //square root
return c;
//return sqrt(pow(aY - bY,2)+ pow(aX - bY,2))
}
int main()
{
cout << distance(5,6,2,2);
return 0;
}
N2-->
Berilgan nuqta aylana ichidami yo'qmi aniqlaydigan funksiya tuzing.
- nomi: pointIsInCircle
- parametrlar:
- aylana markazini anglatuvchi int cX, int cY
- aylana radiusini anglatuvchi int cRadius
- nuqta koordinasini anglatuvchi int pX, int pY
- qaytarishi: berilgan nuqta aylana ichida bo'lsa
true
yo'qsafalse
qaytaradi. yuqorida yaratilgan distance funksiyasidan foydalaning.
Answer:
#include <iostream>
#include <cmath>
using namespace std;
float distance(int aX, int aY, int bX, int bY)
{
int a= aY - bY;
int b= aX - bY;
int cKvadrat = a*a + b*b;
int c = sqrt(cKvadrat); //square root
return c;
//return sqrt(pow(aY - bY,2)+ pow(aX - bY,2))
}
bool pointIsInCircle(int cX, int cY, int cRadius, int pX, int pY)
{
return distance(cX, cY, pX, pY) < cRadius;
}
int main()
{
cout << pointIsInCircle(3,3,2,5,5) << endl;
return 0;
}
uzbek Article's
30 articles in total
Command design pattern 🥷 O'zbek tilida
read article
Memento Design Pattern O'zbek tilida
read article
Mediator design pattern O'zbek tilida
read article
2D va 3D massivlar haqida C#(C-Sharp) tilida tushuncha
read article
Pattern Matching | Uzbek | C#
read article
Pattern Matching | Uzbek | C#
read article
StringBuilder | C#
read article
Properties in C# | Uzbek
read article
Classes in C# | Uzbek
read article
Nullable value Types | C#
read article
TryParse C# | Int32. Uzbek
read article
Maxsus belgilar | C++ boshlang'ich
read article
setw() & setfill() | C++ boshlang'ich
read article
Computer Vision: from 0 to HERO (5-dars)
read article
Computer Vision: from 0 to HERO (4-dars)
read article
Computer Vision: from 0 to HERO (3-dars)
read article
Computer Vision: from 0 to HERO (1-dars)
read article
Computer Vision: from 0 to HERO (intro)
read article
C++ dasturlash tili (1-dars)
read article
Masala
currently reading
Masofa | Masala
read article
C++ maxsus belgilari
read article
C++| Variables & Data Types
read article
Terminal komandalar| Part 2
read article
TERMINAL KOMANDALARI QUIZ GAME TEST.
read article
C++ foundation | O'zgaruvchilar
read article
My first post
read article
Terminal komandalari | 4, 5
read article
C++ dasturlash tili | 2
read article
Terminal. Day 2
read article
Featured ones: