67 224
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #17445 in Action Script | Flash | Flex | ColdFusion for arunima.sahoo

Question #17445
a program in c++ using arrays to input 2 words and check whether the 1st word contains the 2nd word or not.
Expert's answer
#include <iostream>
using namespace std;

int main ()
{
charstring1[128], string2[128];
cout<< "Enter string1:" << endl;
cin.getline(string1,sizeof(string1));
cout<< "Enter string2:" << endl;
cin.getline(string2,sizeof(string2));
boolcontains = false;
for(int i = 0; i < sizeof(string1); i++) {
if(string1[i] == string2[0]){
for(int j = 0; j < sizeof(string2); j++) {
if(string1[i] == string2[j]){
contains= true;
}
}
}
}

if(contains) cout << string1 << " contains " <<
string2 << endl;

system("pause");
return0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions