0% found this document useful (0 votes)
189 views4 pages

Variables: MSIL Stands For Microsoft Intermediate Language and IL Stands For Intermediate Language

The document discusses several key concepts in .NET development: 1. MSIL (Microsoft Intermediate Language) is the intermediate language that .NET languages compile to before execution. It requires the .NET framework to run. 2. The CLR (Common Language Runtime) is the virtual machine that executes MSIL code. It handles tasks like garbage collection and code verification. 3. Variables are used to store and manipulate data in memory during program execution. Different variable types like numbers, strings, and custom types can be declared and used.

Uploaded by

bholusingh097
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views4 pages

Variables: MSIL Stands For Microsoft Intermediate Language and IL Stands For Intermediate Language

The document discusses several key concepts in .NET development: 1. MSIL (Microsoft Intermediate Language) is the intermediate language that .NET languages compile to before execution. It requires the .NET framework to run. 2. The CLR (Common Language Runtime) is the virtual machine that executes MSIL code. It handles tasks like garbage collection and code verification. 3. Variables are used to store and manipulate data in memory during program execution. Different variable types like numbers, strings, and custom types can be declared and used.

Uploaded by

bholusingh097
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

MSIL - Microsoft Intermediary Language - that's the language my project is

compiled to. You can run this application (like any other) ONLY if you have
the .NET framework installed. (not good for me)
JIT - Just In Time - compile to other platforms whenever you need it, just in
time.

For example, CSC compiler of C# language converts c# code to MSIL

MSIL stands for Microsoft Intermediate Language and IL stands for Intermediate Language.
Both are same and IL is just short form MSIL. MSIL is CPU independent code and contains
instructions that are readily convertible to native code.

MSIL or IL is the assembly language that every .Net language first compiles into using their
respective compiler.

CLR is an abbreviation for Common Language Runtime and is the most vital component of
the .NET framework. All languages have runtime and it is the responsibility of a runtime to take
care of the code execution.

For example, Java has its Java Virtual Machine and VB6 has MSVBVM60.Dll. Similarly .Net
has CLR.

The CLR has the following responsibilities :

 Execute IL (Intermediate Language) code


 Garbage Collection
 Code Access Security
 Code verification, etc.

Variables
A variable is a place in memory where the application can store some type of information. This
information can be a number, a string, a class, a delegate, or even a custom data type. Variables
are very important for data manipulation. It would be hard to create a useful program that had no
way of storing and manipulating different types of data. A computer variable is very similar to
algebraic variables used in high school math. For example:

x = 5
y = 4x + 2
By using algebra we can solve for y. We can do this by first substituting the value of x into the
equation, and then adding 2 to 4*x. The final result is 4*5 + 2 = 22.

namespace (C# Reference)


Visual Studio 2005

Other Versions

 Visual Studio 2010


 Visual Studio 2008
 Visual Studio .NET 2003

The namespace keyword is used to declare a scope. This namespace scope lets you organize
code and gives you a way to create globally unique types.

Copy

namespace SampleNamespace
{
class SampleClass{}
interface SampleInterface{}
struct SampleStruct{}
enum SampleEnum{a,b}
delegate void SampleDelegate(int i);
namespace SampleNamespace.Nested
{
class SampleClass2{}
}
}
Remarks

Within a namespace, you can declare one or more of the following types:

 another namespace

 class
 interface

 struct

 enum

 delegate

Console.Read -
Reads the next character from the standard input stream.

Console.ReadLine -
Reads the next line of characters from the standard input stream.

Use Console.Read when you need to read a single character from the input stream.
Use Console.ReadLine when you need to read a string from the user.

using System;

class Program
{
static void Main()
{
Console.WriteLine("{0} = {1}",
100,
ConvertTemp.ConvertCelsiusToFahrenheit(100));

Console.WriteLine("{0} = {1}",
212,
ConvertTemp.ConvertFahrenheitToCelsius(212));

Console.WriteLine("{0} = {1}",
50,
ConvertTemp.ConvertCelsiusToFahrenheit(50));

Console.WriteLine("{0} = {1}",
122,
ConvertTemp.ConvertFahrenheitToCelsius(122));
}

static class ConvertTemp


{
public static double ConvertCelsiusToFahrenheit(double c)
{
return ((9.0 / 5.0) * c) + 32;
}

public static double ConvertFahrenheitToCelsius(double f)


{
return (5.0 / 9.0) * (f - 32);
}
}
}

using System;

class Program
{
static void Main()
{
//
// Show the temperature of the human body in Celsius.
//
double h = 98.6;
double hc = ConvertTemp.ConvertFahrenheitToCelsius(h);
Console.WriteLine("{0}, {1}",
h.ToString(),
hc.ToString("00.0"));

}
}

You might also like