Advertisement
Sierra_ONE

Billing It Is

Oct 15th, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | Source Code | 0 0
  1. /*Write a program that asks the user to enter their total bill at a restaurant. If the bill is $100 or more, print "You are eligible for a 10% discount." If the bill is between $50 and $99, print "You are eligible for a 5% discount." If the bill is less than $50, print "No discount is applicable." */
  2.  
  3. #include <stdio.h>
  4.  
  5. int main() {
  6.  
  7.     int bill;
  8.    
  9.     printf("Enter your total bill: ");
  10.     scanf("%d", &bill);
  11.    
  12.  
  13.     if (bill >= 50 && bill <= 99){
  14.         printf("You are eligible for a 5%% discount");     
  15.     }
  16.     else if (bill > 100){
  17.         printf("You are eligible for a 10%% discount");
  18.     }
  19.     else{
  20.     printf("No discount applicable");      
  21.     }
  22.  
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement