Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Types of Conversions- C++

using System; 
public class CodingNinjas
{
    public static void Main(string[] args)
    {
        Console.WriteLine ("Hello World");
        int Test1 = 9;
        // Automatic casting: int to double
        double Test2 = Test1;
        // Produces Output as 9
        Console.WriteLine(Test1);
        // Produces Output as 9
        Console.WriteLine(Test2);      
        // Produces Output as System.Double
        Console.WriteLine(Test2.GetType());   
    }
}
Source by www.codingninjas.com #
 
PREVIOUS NEXT
Tagged: #Types
ADD COMMENT
Topic
Name
3+6 =