Write the following program using the if/else decision structure using C programming. This problem calculates the cost of a movie ticket. If a person is 5 years old or younger, the movie ticket is free. If the person is over 65, then the movie ticket costs $5.00. Everyone else pays $10.00. Your program should ask for the person’s age. It should also print output which looks like this: You are (put their age her) year old, so your movie ticket will cost ( put the amount here). Upload a screenshot of your program and the results of running the program.
#include<stdio.h>
int main() {
int age;
printf("Enter the age : ");
scanf("%d",&age);
if(age<=5)
printf("You are %d year old, so your movie ticket will cost
free",age);
else if(age>65)
printf("You are %d year old, so your movie ticket will cost
$5.00",age);
else
printf("You are %d year old, so your movie ticket will cost
$10.00",age);
}
// If any doubt please comment
Get Answers For Free
Most questions answered within 1 hours.