#include<stdio.h> #define MAXGROUP 3 void mm(char st[], int func); int main(void
ID: 3613428 • Letter: #
Question
#include<stdio.h>#define MAXGROUP 3
void mm(char st[], int func);
int main(void)
{
char meetday[MAXGROUP];
char ch;
int count;
int index;
printf("Please enter a number ");
scanf("%d", &count);
printf(" Below are the a.m or p.m info for the meeting time of theassociated group or activity ");
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]);
while ((ch = getchar()) != ' ' );
}
mm(meetday, count);
return 0;
}
void mm(char st[], int func)
{
int index;
for(index=0;index<func;index++)
printf("The value is%c ", st[index]);
}
EVERYTIME I EXECUTE IT, IT DOESN'T PRINT THE FIRST P BUT
IT WORKS FIND WHEN I ASSIGN CONSTANT TO THE "COUNT" VARIABLE, BUT IDON'T WANT IT LIKE THAT, I WANT THE USER TO DETERMINE THE MEETINGTIME. THANKS
Explanation / Answer
//Hope this will help you. #include #define MAXGROUP 3 void mm(char st[], int func); int main(void) { char meetday[MAXGROUP]; char ch; int count; int index; printf("Please enter a number "); scanf("%d", &count); printf(" Below are the a.m or p.m info for the meeting time of theassociated group or activity "); 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;indexRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.