Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int callday;
- int callstart;
- double callduration;
- int callcost;
- printf("enter callday was made(1-sunday...7-saturday)::");
- scanf("%d",&callday);
- printf("\nenter callstart in 24hrs format::");
- scanf("%d",&callstart);
- if (callday<=6 && callday>=2 && callstart>=600&&callstart<=1800)
- {
- printf("chargerate for callday is 2.50");
- }
- else
- {
- if (7==callday||1==callday)
- {
- printf("chargerate for callday is 1.50");
- }
- else
- {
- printf("chargerate for callday is 2.00");
- }
- }
- printf("\nenter callduration::");
- scanf("%lf",&callduration);
- printf("ceil value of callduration: %f\n",ceil(callduration));
- callcost=(callstart)*ceil(callduration);
- printf("your bill is %d", callcost);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement