-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStackExample.cs
39 lines (35 loc) · 1.14 KB
/
StackExample.cs
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
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SkillMineProject7.DynamicAndExplicit
{
class StackExample
{
private dynamic data;
public dynamic Element { get; set; }
static dynamic Test()
{
return "ABC";
}
static void Main(string[] args)
{
/* float a = 1.5f;
int b = (int)a; //explicit type casting
int c = Convert.ToInt32(a);
int d = int.Parse(Console.ReadLine());
Console.WriteLine(d);*/ //explicit tyep casting
short s = Convert.ToInt16(Console.ReadLine());
Console.WriteLine(s);
int e = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(e);
long l = Convert.ToInt64(Console.ReadLine());
Console.WriteLine(l);
float f = Convert.ToSingle(Console.ReadLine());
Console.WriteLine(f);
double db = Convert.ToDouble(Console.ReadLine());
Console.WriteLine(db);
}
}
}