Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int age, pop;
- float prix,px,ttl;
- int main (){
- printf("---------Bienvenue sur la Place de Cinema ! ---------\n");
- printf("Quel est votre Age ? ");
- scanf ("%d", &age);
- printf("Vous voulez du Pop Corn (2$) ? 1-Oui / 2-Non ! ");
- scanf ("%d", &pop);
- if(age<=0){
- printf("Erreur sur le choix\n");
- }
- if(age<18){
- prix = 7;
- }
- else{
- prix = 12;
- }
- if(pop == 1){
- px = 2;
- }
- else{
- if(pop == 2){
- px = 0;
- }
- else{
- printf("Erreur sur le choix\n");
- }
- }
- ttl = prix + px;
- printf("Le prix total a payer : %.2f $\n", ttl);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement