Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 2/Solution/fr

Deutsch · English · Français · Български · 中文(中国) · 日本語

Tutoriel de Pascal Objet : Entrée/sortie / Solution de l'exercice

pascal
(* Auteur:    Tao Yue
   Date:      19 June 1997
   Description:
      Trouve la somme et la moyenne de 5 nombre prédéfinis
   Version:
      1.0 - version originale
      2.0 - lecture des données au clavier
*)

program SumAverage;

const
   NumberOfIntegers = 5;

var
   A, B, C, D, E : integer;
   Sum : integer;
   Average : real;

begin    (* Main *)
   write ('Entrer le premier nombre: ');
   readln (A);
   write ('Entrer le second nombre: ');
   readln (B);
   write ('Entrer le troisième nombre: ');
   readln (C);
   write ('Entrer le quatrième nombre: ');
   readln (D);
   write ('Entrer le cinquième nombre: ');
   readln (E);
   Sum := A + B + C + D + E;
   Average := Sum / 5;
   writeln ('Nombre d''entiers = ', NumberOfIntegers);
   writeln;
   writeln ('Nombre1:', A:8);
   writeln ('Nombre2:', B:8);
   writeln ('Nombre3:', C:8);
   writeln ('Nombre4:', D:8);
   writeln ('Nombre5:', E:8);
   writeln ('================');
   writeln ('Somme:', Sum:12);
   writeln ('Moyenne:', Average:10:1);
end.

From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 2/Solution/fr", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.