Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*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." */
- #include <stdio.h>
- int main() {
- int bill;
- printf("Enter your total bill: ");
- scanf("%d", &bill);
- if (bill >= 50 && bill <= 99){
- printf("You are eligible for a 5%% discount");
- }
- else if (bill > 100){
- printf("You are eligible for a 10%% discount");
- }
- else{
- printf("No discount applicable");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement