1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Minchanka [31]
2 years ago
13

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++
Computers and Technology
1 answer:
Eddi Din [679]2 years ago
5 0
#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;
}
You might be interested in
Can anybody answer this please hurry
Ludmilka [50]

Answer:

Ada Lovelace

The first one!

Hope this helps!

5 0
3 years ago
Read 2 more answers
Laying on the lawn wondering where the summer's gone marshmallow clouds keep drifting by
nevsk [136]
Umm what?  uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
8 0
4 years ago
If you touch a downed powerline covered or bare, what's the likely outcome
ANEK [815]

you would be shocked, it can even kill you

5 0
3 years ago
When is a handrail required for stairs
ch4aika [34]

Answer: when is not able to get up the stairs like a normal person

Explanation:

5 0
3 years ago
Read 2 more answers
Which statement correctly describes how the density and temperature of air is related .
disa [49]

A. less dense air has a higher temperature

3 0
3 years ago
Other questions:
  • F we are reduced to a set of computer algorithms, how do we differentiate ourselves from our programming or our connectome? is i
    8·1 answer
  • How do you insert a new row into a worksheet
    5·1 answer
  • If you think a query is misspelled, which of the following should you do? Select all that apply.
    7·2 answers
  • An IP address in the form 197.169.100.1 is called a(n) ________. dotted quad encryption key random number sequential access numb
    7·1 answer
  • What is essential to delivering a successful presentation?
    5·2 answers
  • Mix ‘em Let s1 and s2 be 2 c-strings of the same length. Write a function char* mixem(char*s1, char* s2) which returns a c-strin
    15·1 answer
  • If you entered data into row 4 and it should be in row 3, you should _____.
    8·2 answers
  • What is a spreadsheet program?<br> A spreadsheet program is a computerized version of _______
    5·1 answer
  • Advantages of Linux include_____.
    6·1 answer
  • 1) Design a class named Axolotl that holds attributes for an axolotl's name, weight, and color. Include methods to set and get e
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!