Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Saturday, February 19, 2011

C27 : Manipulate strings(using string library functions)

Back to Home   &  C


//Program to manipulate string using library functions.

#include<stdio.h>
#include<conio.h>
void main()
{
char s1[20];
char s2[20];
int l;
clrscr();
printf("Enter two strings\n");
scanf("%s%s",s1,s2);
l=strlen(l);
printf("Length of string=%d\n",l);
strcat(s1,s2);
printf("Combined string=%s",s1);
getch();
}
---------------------------------------------------------------
Output
Enter two strings
Welcome
C
Length of the string=7
Combined string=Welcome C
===============================================

//Error in output
Back to Home   &  C

No comments: