Question
ZYBOOKS HELP. Please advise why I am getting this error in my code and help me fix the code: Program generated too much output. Output
ZYBOOKS HELP.
Please advise why I am getting this error in my code and help me fix the code: Program generated too much output. Output restricted to 50000 characters. Check program for any unterminated loops generating output.
#include
int main() { int jerseyNumber[5]; int rating[5]; int num,rate; int flag=0; char choice='o'; for(int i=0;i<5;i++){ printf(" Enter player %d's jersey number: ",(i+1)); scanf("%d",&num); printf("Enter player %d's rating: ",(i+1)); scanf("%d",&rate); while((num<0 || num>99) || (rate<1 || rate>9)){ printf("Wrong value entered!! Please enter jerseyNumber between 0-99 and rating between 1-9."); if(num<0 || num>99){ printf(" Enter player %d's jersey number: ",(i+1)); scanf("%d",&num); } if(rating[i]<1 || rating[i]>9){ printf("Enter player %d's rating: ",(i+1)); scanf("%d",&rate); } } jerseyNumber[i]=num; rating[i]=rate; } printf(" ROSTER"); for(int i=0; i<5;i++){ printf(" Player %d -- Jersey number: %d, Rating: %d",(i+1),jerseyNumber[i],rating[i]); } int countRoster=5; while(choice!='q'){ printf(" MENU u - Update player rating a - Output players above a rating r - Replace Player o - Output roster q - Quit Choose an option : "); getchar(); choice=getchar(); if(choice=='a'){ int ratings; printf("Enter a rating: "); scanf("%d",&ratings); int fl=0,index=1; printf("Above %d",ratings); for(int i=0;i
} else if(choice=='q' ){ printf("Quiting program."); } else{ printf("Wrong choice entered."); }
}
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started