programming-examples/c-sharp/Functions/C# Program to Ilustrate Nullable Data Types.cs

26 lines
608 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Ilustrate Nullable Data Types
*/
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();
}
}
}
/*
Nullables : ,100,,3.1457
A Nullable Boolean Value :