How to Write a C Program to calculate Talk time (TT) and Recharge Amount in C Programming Language ?
Calculate Talk time and Recharge amount.
Being 9.3% tax of TRAI for telecom service provider you can calculate Your talk time and recharge amount
1. For Conversation Recharge Amount to talk time
2. For Conversation Talk time to recharge amount
Solution:
- #include <stdio.h>
- #include <conio.h>
- void main()
- {
- int ch;
- float a,d,b,c,e,f;
- clrscr();
- printf("\t\t\t Calculate Talk time and Recharge amount\nBeing 9.3% tax of TRAI for telecom service provider you can calculate Your talk time and recharge amount");
- printf("\n 1. For Conversation Recharge Amount to talk time\n2. For Conversation Talktime to recharge amount");
- printf("\n\n Please Enter your choice: ");
- scanf("%d",&ch);
- switch(ch)
- {
- case 1:
- {
- printf("\nYou chosing opt. %d and your opt. is conversation Recharge Amt. to TT\nPlease Enter for calculation",ch);
- getch();
- clrscr();
- printf("\nPlease enter your recharge amount: ");
- scanf("%f",&a);
- printf("\nPlease Enter processing fee: ");
- scanf("%f",&b);
- printf("\nPlease Enter extra charge: ");
- scanf("%f",&c);
- d=a*0.093;
- e=a-d;
- f=e-b-c;
- printf("\nYour Entered amount is: %.f\n\nYour processing fee is %.f\n\nService Tax= %.2f\n\nYour total talk time(deduction of your service tax only)= %.2f\n\nTotal Talk Time(Deduction of all tax)= %.2f Rupees",a,b,d,e,f);
- break;
- }
- case 2:
- {
- printf("\n You chosing opt. %d and your opt. is conversation TT to Rec. Amt.\nPlease Enter for calculation",ch);
- getch();
- clrscr();
- printf("\nEnter your Talktime: ");
- scanf("%f",&a);
- printf("\nPlease enter Procesing fee: ");
- scanf("%f",&b);
- printf("\nPlease enter all taxes: ");
- scanf("%f",&c);
- d=b+c;
- e=a+d;
- f=(e/(1-0.093));
- printf("\nYour Talk Time(included of all taxes): %.2f\n\nFor getting your given Talk Time you must rechage equal or above= %.f Rupees",a,f);
- break;
- }
- default:
- {
- printf("\nInvalid Choice!!");
- }
- }
- getch();
- }