Question:An enum is defined in a program as follows:
[Flags]
public enum Permissions
{
None = 0,
Read = 1,
Write = 2,
Delete = 4
}
What will be the output of the following Main program (which has access to the enum defined above) in this C# console application (Assume required namespaces are included) :
static void Main(string[] args)
{
var permissions = Permissions.Read | Permissions.Write;
if ((permissions & Permissions.Write) == Permissions.Write)
{
Console.WriteLine("Write");
}
if ((permissions & Permissions.Delete) == Permissions.Delete)
{
Console.WriteLine("Delete");
}
if ((permissions & Permissions.Read) == Permissions.Read)
{
Console.WriteLine("Read");
}
Console.ReadLine();
}