Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- printf("Select the suitable package for you.\n");
- printf("1. 350mb any time data for Rs.29\n");
- printf("2. 350 SMS for Rs.29\n");
- printf("3. Activate both packages for Rs.49 and save Rs.10\n");
- int type, ch = 'Y';
- int sCount = 0, countH = 0, countM = 0, countF = 0;
- while ((sCount <= 100) && (ch == 'Y'|| ch == 'y'))
- {
- printf("\nEnter card type : ");
- scanf(" %d", &type);
- if (type == 1)
- countH++;
- else if (type == 2)
- countM++;
- else if (type == 3)
- countF++;
- else
- printf("Invalid course type");
- sCount++;
- if (sCount >= 10)
- {
- printf("\nYou have reach the maximum number of ragistration for the day");
- break;
- }
- else
- {
- printf("\nDo you want do another registration (Y/N): ");
- scanf("%*c%c", &ch);
- }
- }
- printf("\n----------------------------------------------");
- printf("\n No. of data recharge you have requested : %d\n", countH);
- printf("total ammount : Rs.%.2f\ntotal data: %i mb\n\n",countH * 350, countH * 29.0);
- printf("No. No. of SMS recharge you have requested : %d\n", countM);
- printf("total ammount : Rs.%.2f\ntotal SMS: %i\n\n",countM * 350, countM * 29.0);
- printf("No. of combo recharge you have requested : %d\n", countF);
- printf("total ammount : Rs.%.2f\ntotal SMS: %i\ntotal data: %i mb\n\n",countF*350,countF*350, countF * 49.0);
- printf("In total\nammount : Rs.%.2f\ntotal SMS: %i\ntotal data: %i mb\n\n",countF*350+countH*350+countM*350,countF*350+countH*350+countM*350,countM*29 + countH*29+countF * 49.0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement