0

Help me to rearrange. Thank for help

Rearrange the code to find and print the smallest element of the array (n is the size of the array). } small = arr[x]; cout << small; if(arr[x] < small) for(int x=1; x<n; x++) { int small = arr[0];

4th Oct 2016, 2:43 PM
David Ansoumane Haba
David Ansoumane Haba - avatar
2 Antworten
0
I am facing the same rerange problem :(
4th Oct 2016, 7:38 PM
Jan Darwish
0
ok here is the right answer :) int small = arr[0]; for(int x=1; x<n; x++) { if(arr[x] < small) small = arr[x]; } cout << small;
4th Oct 2016, 7:45 PM
Jan Darwish