Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 1/Solution/fr

한국어 · Deutsch · English · Français · Български · Русский · 中文(中国) · 日本語

Tutoriel de Pascal Objet : Bases / Solution de l'exercice

Voici une façon de réussir l'exercice de la page précédente.

pascal
(* Author :    Tao Yue
   Date :      19 June 1997
   Description :
      Trouver la somme et la moyenne de 5 nombres
   Version:
      1.0 - original version
*)

program SumAverage;

const
   NumberOfIntegers = 5;

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

begin    (* Main *)
   A := 45;
   B := 7;
   C := 68;
   D := 2;
   E := 34;
   Sum := A + B + C + D + E;
   Average := Sum / NumberOfIntegers;
   writeln ('Nombre d''entiers = ', NumberOfIntegers);
   writeln ('Nombre1 = ', A);
   writeln ('Nombre2 = ', B);
   writeln ('Nombre3 = ', C);
   writeln ('Nombre4 = ', D);
   writeln ('Nombre5 = ', E);
   writeln ('Somme = ', Sum);
   writeln ('Moyenne = ', Average)
end.     (* Main *)

From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 1/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.