Skip to main content

Concatenation Of String

Concatenation Of String



#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
string str1="programming";
string str2="hub";
string str3;
int len;
str3=str1;
cout<<str3;
str3=str1+str2;
cout<<str3<<endl;
len=str3.size();
cout<<len<<endl;
getch();
}

Comments

Popular posts from this blog

C++ Program Finding The Absolute Value

#include<iostream> using namespace std; int main() { cout<<" enter any number"; cin>>num; if(num>0) { cout<<"The absolute value of number is:"<< num; } else { cout<<"The absolute value of number is :"<< -(num); } return 0; } OUTPUT Enter Any number: 2 The absolute value of number is 2