show user's enter names in alphabetical order : Write a program that asks the user to enter three names, and then displays the names sorted in alphabetical order. Assume that none of the names are the same. For example, if the user entered “Charlie,” “Leslie,” and “Andy,” the program would display:
Andy Charlie Leslie......

but my output is:

**Enter a name: charlie

Enter a name: leslie

Enter a name: andy

andy leslie charlie

Press any key to continue . . .**

again another output:

**Enter a name: abc

Enter a name: def

Enter a name: ghi

ghi def abc

Press any key to continue . . .**


my output always show third enter name in first order and then second and then first it does't matter what i've write it always show names in this order....
please help me.thanku 


<!-- begin snippet: js hide: false -->

<!-- language: lang-html -->

    const int size = 10;
    	char name1[size];
    	char name2[size];
    	char name3[size];

    	cout << "Enter a name: ";
    	cin.getline(name1, size);
    	cout << "Enter a name: ";
    	cin.getline(name2, size);
    	cout << "Enter a name: ";
    	cin.getline(name3, size);


    	if ("name1" > "name2" && "name1" > "name3")
    	{
    		cout << name1 << " ";
    		if ("name2" > "name3")
    		{
    			cout << name2 << " " << name3 << endl;
    		}
    		else
    		{
    			cout << name3 << " " << name2 << endl;
    		}
    	}
    	else if ("name2" > "name1" && "name2" > "name3")
    	{
    		cout << name2 << " ";
    		if ("name1" > "name3")
    		{
    			cout << name1 << " " << name3 << endl;
    		}
    		else
    		{
    			cout << name3 << " " << name1 << endl;
    		}
    	}
    	else if ("name3" > "name1" && "name3" > "name2")
    	{
    		cout << name3 << " ";
    		if ("name1" > "name2")
    		{
    			cout << name1 << " " << name2 << endl;
    		}
    		else
    		{
    			cout << name2 << " " << name1 << endl;
    		}
    	}
    	else
    	{
    		cout << "nothing happened....." << endl;
    	}

<!-- end snippet -->