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.
//executing main program
//creating integers to store data
//Taking input from user:
printf("Enter the total bill: ");
printf("Enter the percentage amount of tip: ");
printf("Enter the cost of cold drinks: ");
//calculating Displaying result
printf("\n \nThe tip is: %d ", ((i-k)*j)/100);
//for disabling automatic close off of program after execution of program
these are coding samples to help you understand more and more.