i have to write a program that checks the presence a string inside another
umm i wrote it but its not working it launches but it doesn't give any output
string
#include <iostream>
#include <stdio.h>
usingnamespace std;
int main()
{
string a;
string b;
size_t found;
cout << "Please Enter Your First String: ";
cin >> a;
cout << "Please Enter Your Second String: ";
cin >> b;
cout << "A = " << a << " B = " << b << endl;
found=a.find(b);
if (a==b)
{
cout << a << " and " << b << " are identical" << endl;
}
elseif (found!=string::npos)
{
cout << "B = " << b << " Found in : " << a << endl;
}
else
{
cout << "B = " << b << " not found in : " << a << endl;
}
}