Wednesday, February 26, 2014

Integer Data Types: (Wk-1), Jan 8, 14

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IntegerDataTypes
{
    class Program
    {
        static void Main(string[] args)
        {
            //This is a line comment.
            //Each variable that you use in a program must be declared;
            //Specify its data type
            //Syntax: data type variable name;

            int x; //this tells C# that x is int meaning that x is an integer
                    //whose range of values is between -2,147, 483, 648 to 2, 147, 483, 647
                    //Once a variable is declared, you can assign a value to it.
                    //making sure that the value is within the specified range.
            x = 5;
            //display the variable x

            Console.Write("X= ");
            Console.WriteLine(x);


            Console.ReadLine();//pause
        }
    }
}

No comments:

Post a Comment