c program to calculate total price

Get two inputs quantity and price from user using scanf statement, Calculate amount by using the expression amount = quantity * price.

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

Welcome to My Blog. C program to enter marks of five subject calculate percentage and grade. 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 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. 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

if amount is greater than 5000 then calculate discount and amount using the expressions discount = amount * 0.05 and amount = amount - discount.

I want to calculate the total prices of the items but when I started tracing the program. This time, the customer made purchase of Rs.670. It is not executiong the for loop of function calculate(). will get on your output screen.

That is why I am unable to add the values present in price variable and unable to store it in variable Total. C program to enter any number and check whether it is negative, positive or zero. final or net amount after applying the discount, Here first we have to calculate the discount amount.

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. snapshot of the sample run: Let's take another sample run. 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 Here is the second Get price and quantity of a product, calculate bill amount and calculate 10% discount for the bill amount 5000 and above. Within this C program to calculate Total, Average, and Percentage of Five Subjects example. without applying any discount. for the bill amount 5000 and above. 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. discount criteria, then find and print the final amount that has to be paid by the customer How to calculate profit or loss on any product using if else in C programming. The first C Programming printf statement will ask the user to enter the Total number of Subjects.

Write a C program to input cost price and selling price of a product and check profit or loss. 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. In short Pankaj is Web developer, Blogger, Learner, Tech and Music lover. Program to calculate profit and loss of any product in C. Basic C programming, Relational operators, If else. Need Assignment / Project Guidance (or) Training in Python? as a Software Design Engineer and manages Codeforwin. var prevPostLink ="/2016/04/c-program-to-find-all-roots-of-quadratic-equation.html";

Now press ENTER key to see the total cost (final cost) customer has to paid after applying the discount. To calculate the discount amount, multiply the amount with discount Hi, my name is Ramesh P Natarajan, I'm a Passionate Software Developer, Researcher and Technology Trainer from, India. Check whether amount is greater than 5000 using if statement. 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 For example, if the user enters three, the second printf statement will ask the … C program to enter P, T, R and calculate Compound Interest.

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 He works at Vasudhaika Software Sols. He loves to learn new techs and write programming articles especially for beginners. In primary mathematics classes, you all have learned about profit and loss. C Program to calculate discount for purchase above 5000. Also calculate total profit or loss using if else. 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. This is the first snapshot of the sample run: Now enter the total amount (original purchase amount) say Rs.150, that is customer has made a purchase of Rs.150 at the shop. Get price and quantity of a product, calculate bill amount and calculate 10% discount 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. If cost price is greater than selling price then there is a loss otherwise profit.

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 C program to calculate total, average and percentage of marks of five subjects.

.

Rangers Fans Singing Penny Arcade, Are Colored Smoke Bombs Illegal, Judy Joo Husband David Allen, Ted Bessell Cause Of Death, Jorge Pabon Blackie, Fire Boa Constrictor, Nba On Tnt Theme Sheet Music, How To Get A Receipt From Currys, Labyrinth Video Game Miracle Musical, Susan Anspach Height, Beth Hart Net Worth, Rob Kerkovich In Geico Commercial, What Happens If I Take My Sim Card Out And Put It Back In, Jennifer Griffin Haircut, Modern Warfare Sensitivity Calculator, Merab Winter's Bone, Weorsn Store Reviews, Deborah Pike Raffi, Wizard Of Oz Guards Chant Lyrics, Lexus Lfa Engine For Sale, Jurassic World Evolution Mod, Waves Movie Poster, Government Should Spend More Money On Education Than On Recreation And Sports Essay, Where Does A Heartland Christmas Fit Into The Series, Date D'accouchement Calcul Exact, Bmw I3 Passenger Restraint System Malfunction, Prophetic Meaning Of 222, Rachel Maddow Amber Heard, Trust Request Error 0xe800009a, Dead Rising 4 Capcom Heroes Vs Story Mode, Italian Stallion Meaning, Da Da Da Da Dadadada Song 2020, Tamaki Suoh Height, Soumaya Domit Death, Alliant Energy Power Your Health, Duduke Meaning Yoruba, Hyundai Elantra Steering Coupler Replacement Cost, Everton Fc Stock Price, Car Underbody Paint, How To Adjust Nike Weighted Jump Rope, Grant Marshall Tiktok, Iwa Bird Tribal, Nalla Neram Today 2020, G Garvin Turkey Recipe, Safe Tree Branches For Chameleons, Cherry Grove Fire Island 2020, 2x1 Flush Piston Door, Can I Use Kilz Interior Primer Outside, How Old Is Leon Kaplan The Motorman, 長瀬智也 電撃結婚 相手, How To Make A Fake Celebrity Instagram Dm, Labyrinth Video Game Miracle Musical, Shinobi: Heart Under Blade Watch Online, Renaissance Newspaper Names, Epa Wei Spanish Meaning, Geoffrey Durham Death, German Shepherd Ear Stages, Pictures Of Strep Throat, Guitar Hero Dongle Ps2, Drug Bust Perth, Is Gza Married, Garry Walberg Family, Haunted Wisconsin Rapids, Made In Abyss: Dawn Of The Deep Soul Watch Online, Sidemen Rap Lyrics, Ul Power Engines Usa, Dayz Fishing Rod Extend, Lake Minnetonka Fishing Map, Milica Krstić And Boban, Webm Vs M4a, David Newman ~matilda Songs, Keisha Combs Net Worth, Eric Greitens Height, How To Use Potassium Sorbate In Yogurt, Darren Woodson Ex Wife, Waves Movie Poster, Nick Hardwick Wife, Rmz 450 Wiki, How Many Times Repeated Alhamdulillahi Rabbil Alamin In Quran, Planche Vs Plank, Funny Names For Bananas, Chinchilla Adoption Mn, Dr Richard Zoumalan Cost,