Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace csharp_youtube_tutorial
- {
- class Program
- {
- static void Main(string[] args)
- {
- var x = "Helluu"; //Basically a constant in c++.
- //Get type of data
- Console.WriteLine("variable x is a {0}", x.GetTypeCode());
- //Casting
- double pi = 3.14;
- int pi_convert_int = (int)pi; //Convert pi to int
- //Some math functions. (built-ins)
- int z = 5;
- int y = 3;
- Console.WriteLine(Math.Max(z, y));
- Console.WriteLine(Math.Min(z, y));
- Console.WriteLine(Math.Sqrt(49));
- Console.WriteLine(Math.Pow(y, 5));
- //Generating random numbers.
- Random rand = new Random();
- Console.WriteLine("Generating random number {0}", (rand.Next(1, 11)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement