Last active
June 25, 2017 12:06
-
-
Save Ambratolm/fec7efca1cc9e62df67f084ebeebba76 to your computer and use it in GitHub Desktop.
Ecrire un algorithme qui affiche, à partir du poids d’une lettre, le montant du timbre nécessaire à son affranchissement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
main() | |
{ | |
printf("--------------------------------\n"); | |
printf("Montant du timbre d'une lettre\n"); | |
printf("--------------------------------\n"); | |
float P; | |
printf("\n"); | |
printf("Entrez le poids de la lettre (en grammes): "); | |
scanf("%f",&P); | |
printf("\n"); | |
if (P<=20) | |
{ | |
printf("Le montant est de: 0,46 euros"); | |
} | |
if (P>20 && P<=50) | |
{ | |
printf("Le montant est de: 0,69 euros"); | |
} | |
if (P>50 && P<=100) | |
{ | |
printf("Le montant est de: 1,02 euros"); | |
} | |
if (P>100) | |
{ | |
printf("Le montant est de: 1,75 euros"); | |
} | |
printf("\n"); | |
printf("\n"); | |
printf("--------------------------------\n"); | |
system("pause"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment