Advertisement
petros11888

Whats up

Nov 25th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int code, time, sms, pagio=12;
  6.     float fpa, total_cost, call_cost, sms_cost, cost;
  7.  
  8.     printf("Plhktrologhste ton kothiko sas, to xrono omilias kai ton arithmo mhnumatwn: ");
  9.     scanf("%d%d%d",&code,&time,&sms);
  10.  
  11.     call_cost = 0.02 * time;
  12.  
  13.     sms_cost = 0.14 * sms;
  14.  
  15.     cost = call_cost + sms_cost + pagio;
  16.  
  17.     fpa = cost * 0.23;
  18.  
  19.     total_cost = cost + fpa;
  20.  
  21.  
  22.     printf("Tmob account\n");
  23.     printf("------------------------------------------------------------------------------\n");
  24.     printf("Customer code\t\ttime\tSMS\tFPA\t|\tTOTAL\n");
  25.     printf("%d\t\t\t%d\t%d\t%.2f\t|\t%.2f\n",code,time,sms,fpa,total_cost);
  26.     printf("________________________________________________________________________________\n");
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement