VUsolutions Transferred to AchiKhasi.com

From December 2011, this blog www.VUsolutions.blogspot.com is transferred to http://achikhasi.com/vu/ . So, you may visit http://achikhasi.com/vu/ for latest study related help.

Back to home VUsolutions

VUsolutions Fans Club [join us for MORE solutions]

VUsolutions on Facebook

Introduction to Programming (for MCS)

Thursday, April 09, 2009 Posted In Edit This
#include
#include
#include
using namespace std;


void swap(string*, int ,int );
void sort(string*);


int main(){
string strings[5];

for(int i=0;i<5;i++)//taking user input
{
cout<<"Enter String "<cin>>strings[i];
}
sort(strings);//calling sort function

for(int i=0;i<5;i++){//print names
cout<}
cout<

}


void swap(string *str, int i, int j)
{
string temp;
temp = str[i];
str[i] = str[j];
str[j] = temp;
}
void sort (string *str)
{
for(int i=0;i<5;i++)
{
for(int j=i+1;j<5;j++)
{
if(str[i].compare(str[j]) >0)
{
swap(str, i, j);
}
}
}
}

Back to home VUsolutions

Shaadi.com: Just create ur account & find ur partner or EARN money, its reall & EASY

VUsolutions Followers (Join NOW and Get Extra Benefits)

Install LATEST toolbar having lot of features - GET solutions on Desktop

toolbar powered by Conduit
Caliplus 300x250 NoFlam VitoLiv 468x60 GlucoLo