Please I just need help on how user can reenter a wrong valuelike: #include<stdi
ID: 3613403 • Letter: P
Question
Please I just need help on how user can reenter a wrong valuelike:#include<stdio.h>
int main(void)
{
int count;
printf("Enter a valuebetween 2 and 5 ");
scanf("%d",&count);
if((count >=2&& (count <=5))
{
printf("Below are the info for the group: ");
printf("ACM is an engineering group organization: ");
printf("BCG is a business group organization: ");
}
else
printf(" Wrong input: Please reenter the value between 2 and5 ");
PLEASE HOW CAN IT GO BACK TO REENTER? PLEASE HELP
}
Explanation / Answer
please rate - thanks a different method #include int main(void) { int count; printf("Enter a valuebetween 2 and 5 "); scanf("%d",&count); while(count5) {printf(" Wrong input: Please reenter the value between 2 and5 "); scanf("%d", &count); } printf("Below are theinfo for the group: "); printf("ACM is anengineering group organization: "); printf("BCG is abusiness group organization: "); return 0; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.