Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- /* char s1[50];
- char s2[50];
- char a[2]=" ";
- cin.getline(s1,50);
- cout<<endl;
- cin.getline(s2,50);
- cout<<endl;
- strcat(s1,a);
- strcat(s1,s2);
- cout<<s1;*/
- int i=0,j=0,k=0;
- char s1[50],s2[50],s3[6]=" ";
- cout<<"Enter first string : ";
- cin.getline(s1,50);
- cout<<"Enter second string : ";
- cin.getline(s2,50);
- for(;s1[i]!='\0';i++){}
- while(s3[k]!='\0')
- {
- s1[i++]=s3[k++];
- }
- while(s2[j]!='\0')
- {
- s1[i++]=s2[j++];
- }
- s1[i]='\0';
- cout<<endl;
- cout<<"Now : "<<s1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement