write a program to calculate the parking charges of a vehicle enter the type of vehicle as a character (c-car b-bus,and no.of hours then calculate the charges given below are rs-20 per hour ,car 10/hr bicycle rs 5/hr
Answers
Answered by
27
Answer:
in c language
Explanation:
#include<stdio.h>
void main()
{
int car=10,bus=20,bi=5,noofhours,fine=0;
char n;
printf("Please enter vehicle details c-car b-bus and B-bicycle");
scanf("%c",&n);
printf("Please enter no of hours");
scanf("%d",&noofhours);
if(n=='c')
{
fine=car*noofhours;
}
else if(n=='b')
{
fine=bus*noofhours;
}
else if(n=='B')
{
fine=bi*noofhours;
}
printf("%d",fine);
}
Similar questions