Theory
Write a program in C to find the largest and smallest word in a string.
/**
* C program to concatenate two strings
*/
#include
#define MAX_SIZE 100 // Maximum string size
int main()
{
char str1[MAX_SIZE], str2[MAX_SIZE];
int i, j;
/* Input two strings from user */
printf("Enter first string: ");
gets(str1);
printf("Enter second string: ");
gets(str2);
/* Move till the end of str1 */
i=0;
while(str1[i] != '\0')
{
i++;
}
/* Copy str2 to str1 */
j = 0;
while(str2[j] != '\0')
{
str1[i] = str2[j];
i++;
j++;
}
// Make sure that str1 is NULL terminated
str1[i] = '\0';
printf("Concatenated string = %s", str1);
return 0;
}/** * C program to concatenate two strings using pointer ....Show More
From Strings in C programming · C programming
Write a program in C to find the largest and smallest word in a string.
Write a C program to find length of a string.
Write a C program to find maximum occurring character in a string.
Write a C program to find total number of vowels and consonants in a string.
Write a C program to compare two strings
Write a C program to search all occurrences of a character in a string.
Write a C program to count occurrences of a word in a given string.
Write a C program to copy one string to another string.