Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~150 People Reached
Favorite Forums
Favorite Tags
c++ x 1
Member Avatar for Satish_14

#include<iostream> using namespace std; int findmaxindex(int a[],int ,int); void swap(int a[],int ,int); int main(){ int n; cout<<"give the number of elements to sort"<<endl; cin>>n; if(n>100){cout<<"invalid"<<endl; return -1; } if(n<=0){cout<<"invalid"<<endl; return -1; } int count,a[100]; cout<<"give"<<n<<"integers to sort"<<endl; for(count=0;count<n;count++){ cin>>a[count]; } int currtop,currmaxindex; for(currtop=0;currtop<n;currtop++){ currmaxindex=findmaxindex(a,currtop,n); swap(a,currtop,currmaxindex); } return 0; } int …

Member Avatar for DGPickett
0
150