Answer to Question #311156 in C# for Mayo

Question #311156

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

1
Expert's answer
2022-03-14T08:38:59-0400
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();
        }
    }

 

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS