-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (33 loc) · 927 Bytes
/
Copy pathProgram.cs
File metadata and controls
37 lines (33 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace typeconverstion
{
class Program
{
static void Main(string[] args)
{
//implicit operation
int myInt = 9;
double myDouble = myInt;
Console.WriteLine(myDouble);
//explisit operation
double myDouble1 = 9.78;
int myInt1 = (int)myDouble;
Console.WriteLine(myInt1);
//boxing operation
int m = 10;
object om = m;
m = 20;
Console.WriteLine(m);
Console.WriteLine(om);
//unboxing operation
int i = 30;
object ob = i;
int j = (int)ob;
Console.WriteLine(i);
Console.WriteLine(j);
}
}
}