click on this link......

LinkGrand.com

Wednesday 23 January 2013

string concatenation without inbuilt function

#include<stdio.h>
#include<conio.h>
void main()
{
    char str1[25],str2[25],str3[25];
    int i=0,j=0;
    clrscr();
    printf("\nEnter the first string:");
    gets(str1);
    printf("\nEnter the second string:");
    gets(str2);
    while(str1[i]!='\0')
    {
        str3[i]=str1[i];
        i++;

    }
    while(str2[j]!='\0')
    {
        str3[i]=str2[j];
        i++;
        j++;
    }
    str3[i]='\0';
    printf("\nconcatenated string is %s ",str3);
    getch();
}

string concatenation without inbuilt function
string concatenation without inbuilt function

No comments:

Post a Comment