├── Program.cs ├── README.md └── قدر مطلق یک عدد اعشاری درسی شارپ.pdf /Program.cs: -------------------------------------------------------------------------------- 1 | // Decimal number 2 | double number = -23.45; 3 | 4 | // Calculate absolute value 5 | double absoluteValue = Math.Abs(number); 6 | 7 | // Display the result 8 | Console.WriteLine($"The absolute value of {number} is: {absoluteValue}"); 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # آموزش قدر مطلق یک عدد اعشاری درسی شارپ 3 | 4 | **نمونه کد C# برای محاسبه قدر مطلق** 5 | 6 | ```csharp 7 | // عدد اعشاری 8 | double number = -23.45; 9 | 10 | // محاسبه قدر مطلق 11 | double absoluteValue = Math.Abs(number); 12 | 13 | // نمایش نتیجه 14 | Console.WriteLine($"قدر مطلق {number} برابر است با: {absoluteValue}"); 15 | ``` 16 | **خروجی کد :** 17 | 18 | **قدر مطلق -23.45 برابر است با: 23.45** 19 |
20 |
21 | 22 | 23 | # How to Calculate the Absolute Value of a Decimal Number in C# 24 | 25 | **Sample C# Code to Calculate Absolute Value** 26 | 27 | ```csharp 28 | // Decimal number 29 | double number = -23.45; 30 | 31 | // Calculate absolute value 32 | double absoluteValue = Math.Abs(number); 33 | 34 | // Display the result 35 | Console.WriteLine($"The absolute value of {number} is: {absoluteValue}"); 36 | ``` 37 | **Run Code : The absolute value of -23.45 is: 23.45** 38 | -------------------------------------------------------------------------------- /قدر مطلق یک عدد اعشاری درسی شارپ.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adko1396/Teaching-absolute-value-in-CSharp/6b8162fa7d04b87a4ad19a7a115510426ef8c8a2/قدر مطلق یک عدد اعشاری درسی شارپ.pdf --------------------------------------------------------------------------------