We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7e478a commit 95d9cd3Copy full SHA for 95d9cd3
stringconcatenatewithfunandwithoutfun.c
@@ -0,0 +1,31 @@
1
+#include<stdio.h>
2
+#include<string.h>
3
+void main()
4
+{
5
+ char s[50],d[50],f[100];
6
+ int i,j=0;
7
+ printf("Enter string 1\n");
8
+ gets(s);
9
+ printf("Enter string 2\n");
10
+ gets(d);
11
+
12
+ for(i=0;s[i]!='\0';i++)
13
+ {
14
+ f[j]=s[i];
15
+ j++;
16
+ }
17
+ for(i=0;d[i]!='\0';i++)
18
19
+ f[j]=d[i];
20
21
22
+ printf("String concatenation (without function) is ");
23
+ for(i=0;i<j;i++)
24
25
+ printf("%c",f[i]);
26
27
+ printf("\n");
28
+ strcat(s,d);
29
+ printf("String concatenation (with function) is ");
30
+ puts(s);
31
+}
0 commit comments