Write a C# Sharp program to calculate the largest integral value less than or equal and smallest integral value greater than or equal to a given number
- برمجة سي شارب
- برمجة
- 2021-05-31
- ahmadghneem
الأجوبة
using System;
using System.Text;
namespace exercises {
class Program {
public static void Main() {
decimal[] values = {
8.03m,
8.34m,
0.12m,
-0.14m,
-8.1m,
-8.6m
};
Console.WriteLine(" Value largest int value smallest int value");
Console.WriteLine(" Value less than or equal greater than or equal");
foreach(decimal value in values)
Console.WriteLine("{0,7} {1,16} {2,20}",
value, Math.Ceiling(value), Math.Floor(value));
}
}
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال