Advertisement
MawraneZiwani

Place de Cinema

Jan 18th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. int age, pop;
  3. float prix,px,ttl;
  4. int main (){
  5.     printf("---------Bienvenue sur la Place de Cinema ! ---------\n");
  6.     printf("Quel est votre Age ? ");
  7.     scanf ("%d", &age);
  8.     printf("Vous voulez du Pop Corn (2$) ? 1-Oui / 2-Non ! ");
  9.     scanf ("%d", &pop);
  10.    
  11.     if(age<=0){
  12.         printf("Erreur sur le choix\n");
  13.     }
  14.     if(age<18){
  15.         prix = 7;
  16.     }
  17.     else{
  18.         prix = 12;
  19.     }
  20.    
  21.     if(pop == 1){
  22.         px = 2;
  23.     }
  24.     else{
  25.         if(pop == 2){
  26.             px = 0;
  27.         }
  28.         else{
  29.             printf("Erreur sur le choix\n");
  30.         }
  31.     }
  32.     ttl = prix + px;
  33.             printf("Le prix total a payer : %.2f $\n", ttl);
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement