-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.cs
More file actions
50 lines (41 loc) · 834 Bytes
/
Copy pathexample.cs
File metadata and controls
50 lines (41 loc) · 834 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
38
39
40
41
42
43
44
45
46
47
48
49
using System;
namespace Application
{
public class example
{
static void Main ()
{
Console.WriteLine("Hello World");
square s = new square();
Console.WriteLine(s.area(2,4));
for(int a = 0 ; a < 2; a++ )
{
Console.WriteLine("a is :"+a);
}
circle c = new circle();
Console.WriteLine(c.area(10));
triangle t = new triangle();
Console.WriteLine(t.area(10,5));
string str = "Ruan";
Console.WriteLine(str.ToLower());
}
}
public class square
{
public int area (int width, int height)
{
return ( width*height );
}
}
public class circle{
public double area (int radius)
{
return ( Math.PI * Math.Pow(Convert.ToDouble(radius),2.0) );
}
}
public class triangle{
public double area (int baselength, int height){
return ( 0.5 * baselength * height );
}
}
}