Program to find whether two strings contain equal number of characters
Answers
Answered by
0
Answer:
Method 1:
#include<iostream.h>
#include<string.h>
void main()
{
char nm1[20],nm2[20];
int x,y;
cout<<"Enter the first string";
cin>>nm1; or gets(nm1);
cout<<"Enter the second string";
cin>>nm2 or gets(nm2);
x=strlen(nm1);
y=strlen(nm2);
if(nm1==nm2)
cout<<"Both contains equal number of character";
else
cout<<'invalid";
}
Explanation:
Similar questions