Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
C# type casting ๐Ÿ’ฑ
Play lesson

C# tutorial for beginners ๐ŸŽต - C# type casting ๐Ÿ’ฑ

5.0 (6)
48 learners

What you'll learn

This course includes

  • 4 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

C# type casting tutorial example explained #C# #type #casting using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // type casting = Converting a value to a different data type // Useful when we accept user input (string) // Different data types can do different things double a = 3.14; int b = Convert.ToInt32(a); int c = 123; double d = Convert.ToDouble(c); int e = 321; String f = Convert.ToString(e); String g = "$"; char h = Convert.ToChar(g); String i = "true"; bool j = Convert.ToBoolean(i); Console.WriteLine(b.GetType()); Console.WriteLine(d.GetType()); Console.WriteLine(f.GetType()); Console.WriteLine(h.GetType()); Console.WriteLine(j.GetType()); Console.ReadKey(); } } }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere