Write a C# Sharp program to add a number of whole and fractional values to a date and time
- برمجة سي شارب
- برمجة
- 2021-06-01
- ahmadghneem
الأجوبة
using System;
public class Example11
{
public static void Main()
{
double[] hours = {.08333, .16667, .25, .33333, .5, .66667, 1, 2,
29, 30, 31, 90, 365};
DateTime dateValue = new DateTime(2016, 8, 16, 12, 0, 0);
foreach (double hour in hours)
Console.WriteLine("{0} + {1} hour(s) = {2}", dateValue, hour,
dateValue.AddHours(hour));
}
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال