Posted by : Waqas Javed Wednesday, 24 December 2014

Allah Ditta wants a program that calculates and displays the amount he should tip a waiter at a restaurant. The program should subtract any cold drink charges from the total bill and then calculate the tip (using a percentage) on the remainder.


#include<stdio.h>;
#include<conio.h>;

//executing main program
void main() 
{
//creating integers to store data
int i;
int j;
int k;


//Taking input from user:
//total bill
printf("Enter the total bill: ");
scanf("%d", &i);

//tip percentage
printf("Enter the percentage amount of tip: ");
scanf("%d", &j);

//cold drinks 
printf("Enter the cost of cold drinks: ");
scanf("%d", &k);

//calculating Displaying result
printf("\n \nThe tip is: %d ", ((i-k)*j)/100);

//for disabling automatic close off of program after execution of program
_getch();
}



these are coding samples to help you understand more and more.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Contact Us

Stay updated for more codes if we u want any code write us by commenting below or email us.
If you want to hire us for your semester project email us at above given email or call or message
Email: 14bscswjaved@seecs.edu.pk
Phone no: 0308-8109708

Popular Post

Powered by Blogger.

- Copyright © BSCS -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -