Computer Science, asked by anshmuchandi, 2 days ago

Write a program to calculate late fees of book not returned as following
First 5 days = ₹2 (Per day)
Next 10 days = ₹4 (Per day)
Above 15 days = ₹6 (Per day)

Answers

Answered by nihasrajgone2005
2

Answer:

double fine=0.0; int n;

printf("Enter the no of days late");

scanf("%d",&n);

if(n<=5)

fine=0.40*n;

else if(n<=10)

fine=0.65*n;

else

fine=0.80*n;

printf("Fine = %lf",fine);

please drop some ❤️❤️❤️

Explanation:

please f-o-l-l-o-w m-e bro please

Answered by MaiTaeKiQueenHu
0

include<stdio.h>

#include<conio.h>

int main()

{

int days;

float fine;

printf("Enter the number of days: ");

scanf("%d", &days);

if (days > 0 && days <= 5)

fine = 0.50 * days;

if (days >= 6 && days <= 10)

fine = 1 * days;

if (days > 10)

fine = 5 * days;

if (days > 30)

{

printf("Your membership would be canceled.\n");

}

printf("You have to pay Rs. %.2f fine.", fine);

}

Similar questions