Pages

Wednesday, November 30, 2011

C Programming to read price of three items, add 13%VAT,10% Service charge and calculate total price


/* to display total price after paying service charge and Tax of three items*/
#include<stdio.h>
#include<stdlib.h>
int main()
{
    float P1,P2,P3,P,VAT,SC,T;
    printf("Enter the price of first article: ");
    scanf("%f",&P1);
    printf("Enter the price of second article: ");
    scanf("%f",&P2);
    printf("Enter the price of third article: ");
    scanf("%f",&P3);
    P=P1+P2+P3;
    VAT=0.13*P;
    SC=0.1*P;
    T=P+VAT+SC;
    printf("The total price paid by costumer:%f",T);
    system("pause");
    return 0;
}

No comments:

Post a Comment