Difference between revisions of "User:Andrew Daniele"
Line 17: | Line 17: | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
/*sorting an array of ints*/ | /*sorting an array of ints*/ | ||
− | void | + | void makeAscending(int* arr, int size) |
{ | { | ||
int i; | int i; |
Revision as of 13:39, 14 September 2013
Name | Andrew Daniele |
IRC | adaniele87 |
GitHub | adaniele87 |
Blog | adaniele87 |
adaniele1 |
Programming Code of the update:
/*sorting an array of ints*/
void makeAscending(int* arr, int size)
{
int i;
int j;
int temp;
for (i = 0; i < size; i++)
{
for(j = i+1; j < size; j++)
{
if (arr[i] > arr[j])
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
}