include stdio include stdafx int main int argc char argv char str1 80

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <stdafx.h>
int main(int argc, char* argv[])
{
char str1[80], str2[80], str3[160];
int i, j, count;
printf("Enter first string:\t");
gets(str1);
printf("Enter second string:\t");
gets(str2);
i = 0;
while (str1[i++] != '\0');
printf("First string length is:\t%d chars\n", i - 1);
j = 0;
while (str2[j++] != '\0');
printf("Second string length is:\t%d chars\n", j - 1);
j = 0;
for (i = 0; str1[i] != ' '; i++) { str3[j] = str1[i]; j++; }
for (i = 0; str2[i] != ' '; i++) { str3[j] = str2[i]; j++; }
printf("First string plus second string are:\t");
puts(str3);