PROGRAM
Program to find whether two strings contain equal number of characters.#include<iostream.h>
#include<string.h>
#include<conio.h>
int main()
{ clrscr();
char string1[50],string2[50];
cout<<"Enter strings \n";
cin.getline(string1,50);
cin.getline(string2,50);
if(strlen(string1)==strlen(string2))
cout<<"\nBoth strings contain equal number"<<"of characters"<<"\n";
else
cout<<"\nBoth strings contain different number"<<"of characters"<<"\n";
return 0;
}
========================================================================
OUTPUT:
Enter strings
Bhavesh
Bhavesh
Both strings contain equal number of characters
========================================================================
No comments:
Post a Comment