insert----Code:#include <iostream> using namespace std; int main () { char word[4]; char target; cin >> word; cin >> target; for (int x=0; x<5; x++) { if (word[x]==target) { cout << "yes" <<endl; } else { cout << "no" <<endl; } } system ("pause"); return 0; }
output of this is:
qwert (I input)
q (I input too)
yes
no
no
no
no
-----
I want 1 yes only if the target character is in the array but 1 no only if it's not in the array. Hope somebody can answer me, thanks.



2Likes
LinkBack URL
About LinkBacks



