Answer to Question #20179 in C++ for apoorva
using namespace std;
cout << "Enter a string: ";
cout << "Enter a character: ";
cin >> character;
int charCount = 0;
for (int c = 0; c < str.size(); c++)
if (str[c] == character)
cout << "There is " << charCount << " occurrences of this character in the given string." << endl;
Thanks for your appreciation!
If you really liked our service please press like-button beside answer field. Thank you!
best program sir...