#include <iostream>
using namespace std;
int modified_array1(int [], int);
int main()
{
int array1[6];
cout << "enter number to sort out\n";
for(int i=0; i<6; i++)
{
cin >> array1[i];
}
modified_array1(array1, 5);
cout << "Sorted numbers are ";
for(int j=0; j<5; j++)
{
cout << array1[j]<< " ";
}
cin.get();
return 0;
}
int modified_array1(int array_of_function[], int size)
{
int temp;
for(int i=0; i<5; i++)
{
for(int j=0;j<5-i;j++)
{
if(array_of_function[j]<array_of_function[j+1])
{
temp = array_of_function[j];
array_of_function[j] = array_of_function[j+1];
array_of_function[j+1]=temp;
}
}
}
}
Thursday, 24 January 2013
passing array from function as parameter
08:24
ATEEK
No comments
0 comments:
Post a Comment