Cinema Ticket Price(Discount Calcluation)

 #include<stdio.h>

void main()

{

int adults, kids, seniors;

float ticket = 200;

float adult_total, kids_total, senior_total, total;


printf("Enter number of adults: ");

 scanf("%d",&adults);


printf("Enter number of kids: ");

 scanf("%d",&kids);


printf("Enter number of senior citizens: "); 

scanf("%d",&seniors);


adult_total = adults * ticket;

kids_total = kids * (ticket * 0.25);

senior_total = seniors * (ticket * 0.75);


total = adult_total + kids_total + senior_total;


printf("\nAdult Ticket Cost = %.2f", adult_total);

printf("\nKids Ticket Cost = %.2f", kids_total);

printf("\nSenior Citizen Ticket Cost = %.2f", senior_total);


printf("\nTotal Amount = %.2f", total);

}

Comments

Popular posts from this blog

Single Program Using All Automatic String Functions

C program for subtraction of two matrices (2D Arrays)

C program for Multiplication of Two matrices