C#.Net – Data Type & Variables Lecturer 04

Department of Technical Education & Training (DTET)
 College of Technology Jaffna 
 National Vocational Qualification Level 5 
Information and Communication Technology Lecture 04 
 C#.Net – Data Type & Variables 
Software programming Module Code: K72C001M04

 


Initializing Variables

using System;

namespace VariableDefinition {

class Program    {

      static void Main(string[] args)      {

         short a;

         int b ;

         double c;

         /* actual initialization */

         a = 10;

         b = 20;

         c = a + b;

Console.WriteLine("a = {0}, b = {1}, c = {2}", a, b, c);

Console.ReadLine();

      }   }

} //result: a = 10, b = 20, c = 30



 K.Thiruthanigesan, B.Sc, M.Sc University College of Jaffna University of Vocational Technology

Post a Comment

0 Comments