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
//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:
Post a Comment