0% found this document useful (0 votes)
5 views1 page

ass9

The document contains a C program that performs operations on two input strings. It includes functions to calculate the length of each string, concatenate them, and compare their equality. The main function handles user input and calls these string manipulation functions.

Uploaded by

mohitek894
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

ass9

The document contains a C program that performs operations on two input strings. It includes functions to calculate the length of each string, concatenate them, and compare their equality. The main function handles user input and calls these string manipulation functions.

Uploaded by

mohitek894
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

h>
#include<string.h>
void stringLength(char s1[50], char s2[50]);
void stringConcatenation(char s1[50], char s2[50]);
void stringCompare(char s1[50], char s2[50]);

int main()
{
char a[50], b[50];
printf("Enter the first String:\n");
scanf("%s", a);
printf("Enter the second String:\n");
scanf("%s", b);

stringLength(a, b);
stringCompare(a, b);
stringConcatenation(a, b);

return 0;
}
void stringLength(char s1[50], char s2[50])
{
int len1 = strlen(s1);
int len2 = strlen(s2);
printf("\nLength of first string is %d", len1);
printf("\nLength of second string is %d", len2);
}

void stringConcatenation(char s1[50], char s2[50])


{
printf("\nConcatenated String is %s",strcat(s1,s2));
}

void stringCompare(char s1[50], char s2[50])


{
if (strcmp(s1, s2) == 0)
{
printf("\nStrings are equal");
}
else
{
printf("\nStrings are not equal");
}
}

You might also like