Swap and bigger string.

 

#include <iostream>

#include <string>

using namespace std; 

int main() 

{ 

string first,second,third;

cout<<"ENTRE FIRST NAME  : ";

cin>>first;

cout<<"ENTRE SECOND NAME  : ";

cin>>second;

if (first != second)

cout<<"BOTH ARE NOT EQUAL"<<endl;

if (first < second)

cout<<first<<"  IS SMALLER STRING"<<endl;

else

cout<<second<<"  IS THE SMALLER STRING"<<endl;

cout<<"AFTER SWAP"<<endl;

third = first;

first = second;

second = third;

cout<<"first string is  "<<first<<endl<<"second string is  "<<second;

return 0;

}

Comments

Popular Posts