Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- metod za vreme ///
- DateTime now = DateTime.Now;
- DateTime softUni = new DateTime(2013, 11, 4);
- Console.WriteLine(now);
- Console.WriteLine(softUni);
- Console.WriteLine("SoftUni's Age : {0}", now - softUni);
- ///
- // Using dates (System.DateTime)
- DateTime today = DateTime.Now;
- Console.WriteLine("Today is: " + today);
- DateTime tomorrow = today.AddDays(1);
- Console.WriteLine("Tomorrow is: " + tomorrow);
- // Calculate cosinus (System.Math)
- double angleDegrees = 60;
- double angleRadians = angleDegrees * Math.PI / 180;
- Console.WriteLine("Cos({0} degrees) = {1}",
- angleDegrees, Math.Cos(angleRadians));
- // Generating random numbers (System.Random)
- Random rnd = new Random();
- Console.WriteLine("Random number in the range [1-99]: " +
- rnd.Next(1, 100));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement