Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

This question was created from Graded Discussion – Buggy Array – CMIS 102 7382

This question was created from Graded Discussion – Buggy Array – CMIS 102 7382 Introduction to Problem Solving and Algorithm Design https://www.coursehero.com/file/35743498/Graded-Discussion-Buggy-Array-CMIS-102-7382-Introduction-to-Problem-Solving-and-Algorithm-Design/

35743498-277119.jpeg

This project is intended to prompt the user to input 10 integer numbers, store those numbers in an array, and then sort the array in ascending order. But I can’t get the bug out my code so it can work properly. I tried different things like adding “#include <math.h>”. #include <stdio.h> int main(){ //initialize 10 int single dimension array int array[10], temp, i, x, y; //promt user for input and store it in the array printf(“Enter 10 Whole Numbers: “); for (i = 0; i < 10; i++){ scanf(“%d”, &array[i]); } printf(“Unsorted Values: \n”); //print current values in array for (i = 0; i < 10; i++){ printf(“Value in index [%d] = %d\n”, i, array[i]); } printf(“\n”); printf(“Sorted Values: \n”); //sort array for (x = 0; x < 10; x++){ for (y = x + 1; y < 10; y++){ if (array[x] > array[y]){ temp = array[x]; array[y] = array[x]; array[y] = temp; } } } //print sorted values for (i = 0; i < 10; i++){ printf(“Value in index [%d] = %d\n”, i, array[i]); } }

35743498-277119.jpeg

Step

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"