Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi I\'m not familiar using character arrays, so it is giving meproblems here, so

ID: 3613414 • Letter: H

Question

Hi I'm not familiar using character arrays, so it is giving meproblems here, so please what do I need to do? Thanks
This is an example

#include<stdio.h>
int main(void)
{
char meetday[3];
            int count = 3;
      
        printf(" Below are thea.m or p.m info for the meeting time of the associated group oractivity ");
               printf("----------------------------------------------------------------------------- ");
               printf(" Enter 'p' for first group meeting time p.m ");
               printf(" Enter 'p' for second group meeting time p.m ");
               printf(" Enter 'p' for third group meeting time p.m ");
               for(index=0;index<count;index++)
               {
                       scanf("%c", &meetday[index]);
                     
                   //THE LOOP IS NOT WORKING, AS SOON AS I ENTER FIRST P THENTHE LOOP TERMINATE. I CAN'T FIGURE OUT WHAT I'M DOING WRONG
               }


Explanation / Answer

please rate -thanks first problem, you're missing a declaration for index 2nd problem when reading characters the enter is left in theinput buffer so it must be "flushed" out #include #include int main(void) {            char meetday[3],ch;             int count = 3;              intindex;              printf(" Below are thea.m or p.m info for the meeting time of the associated group oractivity ");                printf("----------------------------------------------------------------------------- ");                printf(" Enter 'p' for first group meeting time p.m ");                printf(" Enter 'p' for second group meeting time p.m ");                printf(" Enter 'p' for third group meeting time p.m ");                for(index=0;index
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote