A library charges a fine for every book returned late. For first five days the fine is 50 paise, for 6 to 10 days fine is one rupee, and above 10 days fine is five rupees. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine or the appropriate message.

Posted: September 23, 2012 in CSE Sem1, ECE Sem1, Lab 11A, Lab 11A
#include<stdio.h>
int main()
{
	int days;
	scanf("%d",&days);
	if(days<=5)
		printf("Fine is 50 paise");
else	if(days>5&&days<=10)
printf("Fine is 1 rupee");
	else if(days>10&&days<=30)
		printf("Fine is 5 rupee");
else	if(days>30)
		printf("Membership cancelled");
	return 0;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s