Question: C program Write a program that executes loops based on the number of restaurants a user has visited . The program asks for the name

C program Write a program that executes loops based on the number of restaurants a user has visited . The program asks for the name of the restaurant and a rating on a scale of 1 to 10. It then tells the user what restaurant was ranked as a favorite and what restaurant was the least favorite .
C program Write a program that executes loops based on the number
of restaurants a user has visited . The program asks for the
name of the restaurant and a rating on a scale of 1
the loop never ends can u fix it plz using c program

struct restaurant char nm [20]; int rate; int main() 1 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 int n; struct restaurant s[3]; // number of mesturan char nml [50], nm2 [51]; int max=0, min=10, i; printf(" Enter the number of r:\t"); scanf("%s", n) ; //Dunut (" Enter the name and rating of restau for(i=0; imax) BI max=s[i].rate: strcpy(nml,s[i].nm); // copy the name of the restaurant in I if(s[i].rate min) min-s11 rater 86 37 38 39 40 41 42 43 if(s[i].rate min) DO mins[i].rate: strcpy (nm2,3[1].nm); // copy the name of the restaurant in 2 44 I 45 46 47 48 49 50 printf (" max rating: \tid \t name:\tis\t" max, nml); //print the max rating and n printf(" min rating: \tid \t name:\tts\t" ,min, nm2): /print the min rating and na return 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!