Monday, 24 July 2017

Write a Program that show the Library Management using Operators


Write a Program that show the Library Management using Operators:

  
      A library charges a fine for every book returned late. For first 5 days the fine is 50 paise, for 6-10 days fine is one rupee and above 10 days fine is 5 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. 

Code:


#include<stdio.h>

#include<conio.h>
void main()
{
int d;
printf("Enter The No. Of Days ");
scanf("%d",&d);
if(d>=1&&d<=5)
printf("\nYour Fine Is 0.50 Paise");
else if(d>5 && d<=10)
printf("\nYour Fine Is Rs.1");
else if(d>10&&d<=30)
printf("\nYour Fine Is Rs.5");
else
printf("\nYour Membership Is Cancelled");
getch();
clrscr();
}

Output:


Try it yourself.
If you have any problem you can tell me on comment box i will help you.
thanks.

Viral Programs

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.

0 comments:

Post a Comment