using System;
namespace MyFirstProgram
{
internal class Program
{
static void Main(string[] args) // main method
{
double xx = 3;
double xxx = Math.Pow(xx, 4);
Console.WriteLine(xxx); // 81
double yy = Math.Sqrt(Math.Sqrt(xxx));
Console.WriteLine(yy); // 9
double cc = Math.Abs(-123);
Console.WriteLine(cc); // 123
double dd = Math.Round(3.14);
Console.WriteLine(dd); // 3
double ee = Math.Ceiling(3.14);
Console.WriteLine(ee); // 4
double ff = Math.Floor(3.99);
Console.WriteLine(ff); // 3
double gg = 5;
double gggg = Math.Max(gg, 100);
Console.WriteLine(gggg); // 100
double hh = Math.Min(gggg, 10);
Console.WriteLine(hh); // 10
}
}
}
728x90
'언어 > [C#]' 카테고리의 다른 글
[C#] 피타고라스 정리 (hypotenuse) (0) | 2023.03.01 |
---|---|
[C#] 랜덤 Random (Random.Next(), Random.NextDouble()) (0) | 2023.02.25 |
[C#] 연산자 +, -, *, /, ++, +=, -- -=, *=, /= (0) | 2023.02.25 |
[C#] 기본 입력 Console.ReadLine() (0) | 2023.02.25 |
[C#] 함수 설명 method summary (0) | 2023.02.25 |