Advertisement
Lonelyprogrammer29

Sammy

Nov 20th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main()
  4. {
  5. int callday;
  6. int callstart;
  7. double callduration;
  8. int callcost;
  9. printf("enter callday was made(1-sunday...7-saturday)::");
  10. scanf("%d",&callday);
  11.                 printf("\nenter callstart in 24hrs format::");
  12. scanf("%d",&callstart);
  13.  
  14.                 if (callday<=6 && callday>=2 && callstart>=600&&callstart<=1800)
  15.                 {
  16.                                 printf("chargerate for callday is 2.50");
  17.                 }
  18.                 else
  19.               {
  20.                     if (7==callday||1==callday)
  21.                 {
  22.                                 printf("chargerate for callday is 1.50");  
  23.                 }              
  24.                         else
  25.                                 {
  26.                                                 printf("chargerate for callday is 2.00");
  27.                                 }
  28.                  } 
  29. printf("\nenter callduration::");
  30. scanf("%lf",&callduration);
  31. printf("ceil value of callduration: %f\n",ceil(callduration));
  32. callcost=(callstart)*ceil(callduration);
  33. printf("your bill is %d", callcost);
  34. return 0;      
  35.        
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement