var nextPostLink ="/2015/05/c-program-to-enter-student-marks-and-calculate-percentage-and-grade.html"; Pankaj Prakash is the founder, editor and blogger at Codeforwin. Welcome to My Blog. He works at Vasudhaika Software Sols. Need Assignment / Project Guidance (or) Training in Python? C Program to Calculate Purchase Amount to be Paid after Discount - In this tutorial, we will learn about how to create a program in C that will ask from user to enter total shopping amount purchased in the shop, and then apply the discount as per the following discount criteria, then find and print the final amount that has to be paid by the customer after subtracting the discount amount In primary mathematics classes, you all have learned about profit and loss. C program to enter any number and check whether it is negative, positive or zero. This time, the customer made purchase of Rs.670. after subtracting the discount amount: As the program was written under Code::Blocks IDE, therefore after successful build and run, here is the output you Check whether amount is greater than 5000 using if statement. Formula to calculate profit and loss Profit = S.P - C.P (Where S.P is Selling Price and C.P is Cost Price) Loss = C.P - S.Peval(ez_write_tag([[728,90],'codeforwin_org-medrectangle-4','ezslot_2',114,'0','0'])); After quick recap of profit and loss let us code solution for the program. Write a C program to input cost price and selling price of a product and check profit or loss. If cost price is greater than selling price then there is a loss otherwise profit. percentage and divide it by 100 and then initialize it to a variable that hold the discount value say, For example, let's suppose user has purchased few items that costs. Get two inputs quantity and price from user using scanf statement, Calculate amount by using the expression amount = quantity * price. Get price and quantity of a product, calculate bill amount and calculate 10% discount Follow on: Facebook | Twitter | Google | Website or View all posts by Pankaj, C program to check whether a number is divisible by 5 and 11 or not, C program to enter student marks and find percentage and grade. He loves to learn new techs and write programming articles especially for beginners. For example, if the user enters three, the second printf statement will ask the … for the bill amount 5000 and above. Also calculate total profit or loss using if else. C program to calculate total, average and percentage of marks of five subjects. will get on your output screen. I want to calculate the total prices of the items but when I started tracing the program. C program to enter marks of five subject calculate percentage and grade. Software developer, Blogger, Learner, Music Lover... C program to enter P, T, R and calculate Simple Interest, C program to enter P, T, R and calculate Compound Interest, C program to calculate total, average and percentage of marks of five subjects, C program to enter any number and check whether it is negative, positive or zero, C program to enter marks of five subject calculate percentage and grade, C program to enter basic salary of an employee and calculate gross salary. without applying any discount. Within this C program to calculate Total, Average, and Percentage of Five Subjects example. on the whole purchase amount is 25%, If it is, then just ask him/her to pay the orignal purchase amount as final purchase amount Get price and quantity of a product, calculate bill amount and calculate 10% discount for the bill amount 5000 and above. Here is the snapshot of the sample run: Here is another sample run, this time, the customer made purchase of Rs.2000: Here are some of the main steps used in above program: Quick Links to enter total shopping amount purchased in the shop, and then apply the discount as per the following C Program to find greatest among two numbers, C Program to find smallest among two numbers, C Program to find whether the given number is odd or even number, C Program to find whether the difference between two numbers is even or odd, C Program to find whether the given number is 3 digit number or not, C Program to find greatest among three numbers, C Program to find smallest among three numbers, C Program to find whether the given number is divisible by 3, C Program to find whether the given year is leap year or not, C Program to find whether the last digit of given number is divisible by 3, C Program to Arithmetic Calculator using switch case Statements, C Program to find the whether the last digit of given two numbers are equal or not, C Program to calculate different discount for different Bill amount, C Program to check whether ith bit in a number N is set or not, C Program to check odd or even using bitwise operator. As the discount starts only when the purchase amount exceeds Rs.100, Otherwise if the purchase amount exceeds Rs.100, then apply the discount and ask him/her to pay the To calculate the discount amount, multiply the amount with discount In this tutorial, we will learn about how to create a program in C that will ask from user It is not executiong the for loop of function calculate(). Hi, my name is Ramesh P Natarajan, I'm a Passionate Software Developer, Researcher and Technology Trainer from, India. Signup - Login - Give Online Test, If user has purchased something that costs from Rs.101 to Rs.200, the discount will be 5%, If user has purchased something that costs from Rs.201 to Rs.400, the discount will be 10%, If user has purchased something that costs from Rs.401 to Rs.800, the discount will be 20%, And if user has purchased something that costs above Rs.800, the total discount that will be applied The first C Programming printf statement will ask the user to enter the Total number of Subjects. if amount is greater than 5000 then calculate discount and amount using the expressions discount = amount * 0.05 and amount = amount - discount. Now press ENTER key to see the total cost (final cost) customer has to paid after applying the discount. In short Pankaj is Web developer, Blogger, Learner, Tech and Music lover. That is why I am unable to add the values present in price variable and unable to store it in variable Total. Program to calculate profit and loss of any product in C. Basic C programming, Relational operators, If else. final or net amount after applying the discount, Here first we have to calculate the discount amount. discount criteria, then find and print the final amount that has to be paid by the customer

Gouge In Cylinder Head, Aluminum Skiff For Sale, Roblox Secret Promo Codes, Fall Trivia Quiz Answers, London Tyler Bironas, Octoprint Ender 3 Usb, Victoria 2 Hpm Formable Nations,