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
I know that this will be taken down for not being a real question but is anyone else not able to search for anything? I can type
Schach [20]

Answer:

Sameee

Explanation:

6 0
3 years ago
Select the correct answer.
galben [10]

Answer:

the RAM if i am not mistaking

8 0
3 years ago
When you sustain program implementation by staying true to the original design, it is termed A. Goals and objectives B. Program
Naya [18.7K]

Answer:

Program fidelity

Explanation:

7 0
2 years ago
HELLO answer this. Sidney needs to create a decimal number variable that will be added to another number. What kind of variable
kipiarov [429]

Answer:

Option D. float is the correct answer.

Explanation:

Decimal number contains decimal point. Out of all the given data types, float data type store the number with decimal point.

As the number has to be further used for calculations float ahs to be used. Because the numbers can also be stored in string but cannot be used for further calculations.

Hence,

Option D. float is the correct answer.

8 0
3 years ago
Read 2 more answers
At higher doses what behaves like PCP causing feelings of power and invulnerability
ser-zykov [4K]
I don't think any answer would be correct, if you have an option "none of the above" then that would be the correct answer
5 0
3 years ago
Other questions:
  • Write a program that scores a blackjack hand. In blackjack, a player receives from two to five cards. (The player decides how ma
    5·1 answer
  • What is the standard internet protocol, which provides the technical foundation for the public internet?
    9·1 answer
  • What is hydraulic fracturing?
    7·1 answer
  • Which steps will create a new blank word document
    9·1 answer
  • Why are computers useful for modeling situations?
    13·2 answers
  • True or false? Resistors regulate and limit electrical current. A. True B. False
    7·2 answers
  • What makes the huns a formidable force for the roman empire?
    5·1 answer
  • Which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
    12·1 answer
  • How does a modem work​
    13·1 answer
  • List all the steps used to search for 25 in the sequence given below. Use both (a) linear search and (b) binary search. 2, 7, 13
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!