القائمة الرئيسية

الصفحات

 






Corrigée d’exercice 9



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






Algorithme

Variables A,B,C,somme:entiers

 Debut

 Ecrire(" Entrer A:")

 Lire(A)

Ecrire(" Entrer B:")

 Lire(B)

 Ecrire(" Entrer C:")

Lire(C)

somme ← A+B+C

 Ecrire("La somme égal à :",somme)

Fin

Résultat ==> Entrer un Entier: 7

 Entrer un Entier: 1

 Entrer un Entier: 9

 La somme égal à : 17

 

Retour vers l’exercice

 

 

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






#include <stdio.h>

int main() {

 int A,B,C,somme;

 printf(" Entrer A:");

scanf("%d",&A);

 printf(" Entrer B:");

 scanf("%d",&B);

 printf(" Entrer C:");

scanf("%d",&C);

somme = A+B+C ;

printf("La somme egal:%d",somme);

 return 0;

 }


Retour vers l’exercice



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




#include <iostream>

using namespace std;

 int main() {

int A,B,C,somme;

 cout<<" Entrer A:"; cin>>A;

 cout<<" Entrer B:"; cin>>B;

 cout<<" Entrer C:"; cin>>C;

somme = A+B+C ;

cout<<"La somme egal:"<<somme;

 return 0;

 }


Retour vers l’exercice

 

 






هل اعجبك الموضوع :

تعليقات