Question #204784

Write a C Program to Rent a cycle on hourly basis

Per hour charges. Rs. 90 /hour


10 bicles

25 clients

90 per hr charges

Reports

Monthly bill of all cyclists

Every client don't take cycle on rent at daily basis but Can take regular and more than one hour daily


Expert's answer

#include<stdio.h>
float total_numbers(int hour){
	return 90 * hour;
}
int main(){
	int hours_array [25];
	int i;
	for(i = 0; i< 25; i++){
		printf("Enter number of hours took by client  %d cycling in this month:\t\t", (i+1));
		
		scanf("%d", &hours_array[i]);
	}


	int sum = 0;
	for(i = 0; i<25; i++){
		sum += hours_array[i];
		
	}
	printf("The total number of hours clients cycled:\t %d\n", sum);
	printf("\n");
	printf("Monthly bill for all cyclists is:\t %f\n", total_numbers(sum));
	
}
LATEST TUTORIALS
APPROVED BY CLIENTS