QA › Programming › Write an expression to detect that the first character of userInput matches firstLetter.
Q
Write an expression to detect that the first character of userInput matches firstLetter.
Write an expression to detect that the first character of userInput matches firstLetter.
#include
#include
using namespace std;
int main() {
string userInput;
char firstLetter;
getline(cin, userInput);
cin >> firstLetter;
if (/* Your solution goes here */) {
cout << "Found match: " << firstLetter << endl;
}
else {
cout << "No match: " << firstLetter << endl;
}
return 0;
}