-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.cpp
More file actions
33 lines (27 loc) · 1.02 KB
/
math.cpp
File metadata and controls
33 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <cmath>
int main()
{
//pow() sayıların üssünü almamızı sağlar
std::cout << pow(3, 2) << std::endl;
std::cout << pow(3, 5) << std::endl;
//sqrt() sayıların karekökünü bulur
std::cout << sqrt(3) << std::endl;
std::cout << sqrt(36) << std::endl;
std::cout << sqrt(4.4) << std::endl;
//round() sayıları en yakın tam sayıya yuvarlar
std::cout << round(4.3) << std::endl;
std::cout << round(6.5) << std::endl;
//floor() sayıları bir önceki tam sayıya yuvarlar
std::cout << floor(2.1) << std::endl;
std::cout << floor(2.999999) << std::endl;
//ceil() sayılaro bir sonraki tam sayıya yuvarlar
std::cout << ceil(3.3) << std::endl;
std::cout << ceil(7) << std::endl;
//fmax() sayılardan maksimumu bulur
std::cout << fmax(30, 10) << std::endl;
std::cout << fmax(3, 10) << std::endl;
//fmin() sayılardan minimum olanı bulur
std::cout << fmin(30, 10) << std::endl;
std::cout << fmin(3, 10) << std::endl;
}