/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
using System;
class MyArray
{
private double[] arr;
public MyArray(int len)
{
arr=new double[len];
for (int i=0; i < len; ++i)
{
arr[i] = Math.Sin(i);
}
}
public MyArray PrintMe()
{
foreach (double n in arr)
{
Console.WriteLine(n);
}
return this;
}
public void GetMax()
{
double max = 0;
foreach (double n in arr)
{
if (n>max) max = n;
}
Console.WriteLine("Max value: " + max);
}
}
class HelloWorld {
static void Main()
{
MyArray ma = new MyArray(10);
ma.PrintMe().GetMax();
}
}