glx_56de37973380417c75c17f999823807b.txt exo 5 corriges en algorithme https://keidweneth.com/ilrRUQJCUIw6T/60695
الصفحة الرئيسية

exo 5 corriges en algorithme

 

Écrire un programme  qui permet d'afficher le plus grand de trois entiers saisis  au clavier.

******** En Algorithme ********

Algorithme Maximum_Trois_nombres Variables A,B,C,Max :entiers Debut Ecrire(" Entrer A:") Lire(A) Ecrire(" Entrer B:") Lire(B) Ecrire(" Entrer C:") Lire(C) Max ← A Si (B >= Max) alors Max ← B FinSi Si(C >= Max) alors Max ← C FinSi Ecrire("Le Max est",Max) Fin Résultat ==> Entrer un entier A : 8 Entrer un entier B : 3 Entrer un entier C : 1 Le Max est : 8

Retour vers la liste d'exercices

******** En C ********

#include <stdio.h> int main() { int A,B,C,Max; printf(" Entrer A:"); scanf("%d",&A); printf(" Entrer B:"); scanf("%d",&B); printf(" Entrer C:"); scanf("%d",&C); Max = A ; if (B >= Max) Max = B ; if (C >= Max) Max = C ; printf("le Max est %d",Max); return 0; }

Retour vers la liste d'exercices

******** En C++ ********

#include <iostream> using namespace std; int main() { int A,B,C,Max; cout<<" Entrer A:" ; cin>>A; cout<<" Entrer B:" ; cin>>B; cout<<" Entrer C:" ; cin>>C; Max = A ; if (B >= Max) Max = B ; if (C >= Max) Max = C ; cout<<" Le Max est "<<Max; return 0; }

******** En Python ********

A = int(input("Entrer un Entier A :")) B = int(input("Entrer un Entier B :")) C = int(input("Entrer un Entier C :")) Max = A if B >= Max : Max = B if C >= Max : Max = C print("Le maximum est ",Max)


الاسمبريد إلكترونيرسالة