Write a console application that initialize at least five variables or constants with different data types, the displat thier value.Provide a meaningful identifier of the variables or constants.Name the namespace as DataTypeApp and its class as DataTypeProgram
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataTypeApp
{
class DataTypeProgram
{
static void Main(string[] args)
{
int meaningValue = 42;
string greetingValue = "Hellow World!";
double platformNum = 9.75;
DateTime currentDate = DateTime.Now;
bool trueBoolValue = true;
Console.WriteLine("{0}: {1}", "intValue", meaningValue);
Console.WriteLine("{0}: {1}", "strValue", greetingValue);
Console.WriteLine("{0}: {1}", "doubleValue", platformNum);
Console.WriteLine("{0}: {1}", "currentDate", currentDate);
Console.WriteLine("{0}: {1}", "boolValue", trueBoolValue);
Console.ReadKey();
}
}
}
Comments
Leave a comment