Thursday, 9 March 2017

Addition Of String without using strcat() function in C++

#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
main()
{
char n[20],s[50];
int i,j=0,len;
gets(n);
gets(s);
len=strlen(n);
for(i=len;s[j]!='\0';i++)
{
n[i]=s[j];
j++;
}
puts(n);

}

No comments:

Post a Comment

Amazon1Ads