Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

essam1

using System;
namespace Console_Array_NewSet

{
  class Program
  {
    static void main(string[]args){
 int []Array=new int[5];
 int i,j,Temp;
 for (i=0;i<Array.Length;i++)
 {
   Console.WriteLine("input a mount the element"+ i);
   Array[i]=int.Parse(Console.ReadLine());
 }
 for (i=0;i<Array.Length;i++){
   for(j=i+1;j<Array.Length;j++)
   {
     if (Array[i]>Array[j]){
       Temp=Array[i];
       Array[i]=Array[j];
       Array[j]=Temp;
     }
   }
 }
 foreach(int element in Array){
   Console.WriteLine("show element the Array in the new set:"+element);
 
   
 }
 }
    
  }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.