Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a flowchart for this c code #include n i , jarr [ j ] ( a r r [ j ] , arr

I need a flowchart for this c code
#include ni,jarr[j](arr[j],arr[j+1])n,iscanf(%d,8n):??
?''(i=0;i
printf("%s??
, students [i]);
}
return e;
(i=0;i
scanf ("%s", students [i]);
}
bubbleSort(students,n);
printf("
Sorted list of students: {:?
?'');
for (i=0;i
printf("%s??
, students [i]);
}
return e;
}(j=0;j
if(strcmp(arr[j],arr[j+1])>0){
strcpy(temp, arr[j]);
strcpy(arr[j],arr[j+1]);
strcpy(arr[j+1], temp);
}
}
(i=0;i
for (j=0;j
if(strcmp(arr[j],arr[j+1])>0){
strcpy(temp, arr[j]);
strcpy(arr[j],arr[j+1]);
strcpy(arr[j+1], temp);
}
}
}
#include
#include
#define MAX_STUDENTS 100
void bubbleSort(char arr[][50], int n){
int i, j;
char temp[50];
for (i =0; i n -1; i++){
for (j =0; j n - i -1; j++){
if (strcmp(arr[j], arr[j +1])>0){
strcpy(temp, arr[j]);
strcpy(arr[j], arr[j +1]);
strcpy(arr[j +1], temp);
}
}
}
}
S
int main(){
int n, i;
char students[MAX_STUDENTS][50];
printf("Enter the number of students: ");
scanf("%d", &n);
printf("Enter the names of students:
");
for (i =0; i n; i++){
scanf("%s", students[i]);
}
bubbleSort(students, n);
printf("
Sorted list of students:
");
for (i =0; i n; i++){
printf("%s
", students[i]);
}
return 0;
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

Effective Delivery Effective

Answered: 1 week ago