In: Computer Science
#include<stdio.h>
int main() {
int hpark,mpark,totalmin,price=0;
printf("Hours Parked: ");
scanf("%d",&hpark);
printf("\nMinutes Parked: ");
scanf("%d",&mpark);
totalmin=(hpark*60)+(mpark);
do{
if(totalmin<=60)
{
price=price+0;
}
else if(totalmin>60 && totalmin<=240)
{
price=price+((totalmin/20)*2);
}
else if(totalmin>=240)
{
price=price+18;
}
hpark=hpark-24;
totalmin=(hpark*60)+(mpark);
}while(hpark>0);
printf("\nPrice is:%d",price);
}