paulrai238 paulrai238
  • 09-12-2021
  • Computers and Technology
contestada

Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string in c++

Respuesta :

Talanat
Talanat Talanat
  • 09-12-2021
#include
#include

using namespace std;

int CountCharacters(char userChar, string userString){
int result = 0;
for(int i = 0;i if(userString[i] == userChar){
result++;
}
}
return result;
}

int main(){
string userString;
char userChar;
cin>>userChar>>userString;
cout< return 0;
}
Answer Link

Otras preguntas

The declaration of independence begins with the phrase the unaniusm declartion of the thirteen untited states of america
Two puppies which are 520 feet apart are running towards each other. Their speeds are 4 and 5 feet per second. How much time will elapse before they are 250 fee
Research online and identify two online plagiarism checker tools. Choose such tools that you can use for writing your schoolwork. Write a short note describing
what matrix multiplication is possible ?
Help Please! I WILL MARK BRAINLIST!!! Which of the following are ways to express the same probability? Check all that apply. 30% 3/10 1/3 0.3 0.03
What’s the least common multiple (LCM) for each group of numbers? a. 6 and 15 b. 4 and 11 c. 6, 9, and 12 d. 8, 10, and 20 What’s the least common denominator
Explain why mitosis can be thought of as cellular immortality
Please HELP I will mark Brainly!
Como se dice “ tie “ en espanol A. el campeon B. el cesto C. la red D. el empate
Simplifying an algebra -3(y+2)