public static void Exo1()
int[] tab = new int[6] {5,8,3,2,6,4};
foreach ( int element in tab )
Console.WriteLine (element);
public static void Exo2()
int[] tab = new int[6] {5,8,3,2,6,4};
for (int index = 0 ; index < tab.Length -1 ; index ++)
Console.Write(tab[index] + " ; ");
Console.Write(tab.Length -1);
public static void Exo3()
int[] tab = new int[6] {5,8,3,2,6,4};
for (int index = tab.Length -1; index >= 0 ; index --)
Console.Write(tab[index] + " ");
public static void Exo4()
int[] tab = new int[6] {5,8,3,2,6,4};
for (int index = 0 ; index<tab.Length ; index++)
Console.Write(tab[index] + " ");
public static void Exo5()
int[] tab = new int[6] {5,8,3,2,6,4};
for (int index = 0 ; index<tab.Length ; index++)
double pair = tab[index] %2;
Console.Write(tab[index] + " ");
public static void Exo6()
Console.WriteLine("Saisir la taille du tableau voulu");
int a = Convert.ToInt32(Console.ReadLine());
for ( int i = 0 ; i < a ; i++)
Console.Write (tab[i] + " " );
public static void Exo7()
Console.WriteLine("Taille du tableau ?");
int a = Convert.ToInt32(Console.ReadLine());
for (int i = 0 ; i < a ; i++)
Console.Write ( tab[i] + " ");
public static void Exo8()
Console.WriteLine("Taille du tableau ?");
int a = Convert.ToInt32(Console.ReadLine());
for (int i = 0 ; i < a ; i++)
Console.Write(tab [i] + " ");
public static void Exo9()
Console.WriteLine("Saisir une taille entre 2 et 5");
taille = Convert.ToInt32(Console.ReadLine());
} while ( taille < 2 || taille > 5 );
double[]tab = new double [taille];
for ( int index = 0 ; index < tab.Length ; index++)
Console.WriteLine ("Saisir un nombre");
double a = Convert.ToDouble(Console.ReadLine());
double moyenne = (s)/(taille);
Console.WriteLine("La moyenne est : " + moyenne);
public static void Exo10()
int[] tab = {1 , 23 , 45 , 6 , 7};
for (int i = 0 ; i < tab.Length ; i ++)
Console.WriteLine("----");
Console.WriteLine( "|0" + tab[i] + "|");
Console.WriteLine( "|" + tab[i] + "|");
Console.WriteLine("----");
public static void Exo11()
int [] tab = {1,23,45,6,7};
Console.WriteLine("--------------------");
for ( int i = 0 ; i < tab.Length ; i++)
Console.Write("|0" + tab [i] + "|");
Console.Write("|" + tab [i] + "|");
Console.WriteLine("--------------------");
public static void Main()