static void Main(string[] args)
{
//Sum of all elements in an array
int[] array=new int []{2,2,2,2};
int sum1 = [Link]();
[Link]("The sum is: {0}", sum1);
[Link]();
}
//Ascending the elements of the array
using System;
using [Link];
using [Link];
using [Link];
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[] a = new int[5];
int tmp, j;
[Link]("Enter the element of the array:");
for (int i = 0; i < [Link]; i++)
{
[Link]("Element {0};",i);
a[i] = Convert.ToInt32([Link]());
}
for (int i = 0; i < [Link]; i++)
{
for ( j = i + 1; j < [Link]; j++)
{
if (a[j] < a[i])
{
tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
}
}
[Link]("{0} {1} {2} {3} {4}", a[0],
a[1],a[2],a[3],a[4]);
[Link]();
}
}
}