Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to calculate net bill by deducting discount

Posted By: Zara Hughes     Category: C Programming     Views: 11151

Write a program to calculate net bill by deducting discount.

Code for Program to calculate net bill by deducting discount in C Programming

#include<stdio.h>
void main()
{
        float number1,disc,bill;
        printf("Total purchace=>");
        if(scanf("%f",&number1)==1)
        {
                if(number1>1000)
                        disc=number1*0.04;
                elseif(number1>500)
                        disc=number1*0.02;
                else
                        disc=0;
        bill=number1-disc;
        printf("\nYour bill is Rs.%9.2f",bill);
        }

        else
        {
                printf("error enter correct value");
        }
}


=======================OUTPUT==========================

Total purchace=>800
Your bill is Rs.   784.00

Total purchace=>300
Your bill is Rs.   300.00

Total purchace=>1220
Your bill is Rs.  1171.20
  
Share: 


Didn't find what you were looking for? Find more on Program to calculate net bill by deducting discount Or get search suggestion and latest updates.

Zara Hughes
Zara Hughes author of Program to calculate net bill by deducting discount is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!