Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i, a[100], n = 10, sem, Pfizer = 0, Sinopharm = 0, Moderna = 0, Sputnik = 0;
- char flag;
- for (i = 1; i <= n; i++)
- {
- printf("1. Pfizer\n");
- printf("2. Sinopharm\n");
- printf("3. Moderna\n");
- printf("4. Sputnik\n");
- printf("\nEnter the number of your vaccine : ");
- scanf("%d", &a[i]);
- if (a[i] == 1)
- {
- Pfizer++;
- }
- else if (a[i] == 2)
- {
- Sinopharm++;
- }
- else if (a[i] == 3)
- {
- Moderna++;
- }
- else if (a[i] == 4)
- {
- Sputnik++;
- }
- else
- {
- printf("Invalid.\n");
- }
- }
- printf("The number of Pfizer = %d\n", Pfizer);
- printf("The number of Sinopharm = %d\n", Sinopharm);
- printf("The number of Moderna = %d\n", Moderna);
- printf("The number of Sputnik = %d\n", Sputnik);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement