Sunday, 3 December 2017

C# Program to Ilustrate Nullable Data Types


Code:

using System;
namespace Application
{
    class Nullables
    {
        static void Main(string[] args)
        {
            int? num1 = null;
            int? num2 = 100;
            double? num3 = new double?();
            double? num4 = 3.14157;
            bool? boolval = new bool?();
            Console.WriteLine("Nullables : {0}, {1}, {2}, {3}",
                               num1, num2, num3, num4);
            Console.WriteLine("A Nullable boolean value: {0}", boolval);
            Console.ReadLine();

        }
    }
}


Output:

Nullables : ,100,,3.1457
A Nullable Boolean Value :


More C# Programs:





















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...