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
Which of the following is FALSE? Select one: a. The fast-paced and collaboration-based business environment makes email less use
12345 [234]

Answer:

The Atos case demonstrates that it is possible to cut out e-mail entirely.

Explanation:

6 0
3 years ago
How to write my name in binary code ? Rivas
wel

Your name in binary would be "01010010 01101001 01110110 01100001 01110011"

3 0
3 years ago
Read 2 more answers
Which statement is false? Select one: a. Function printf does not care how large the array it is printing is. b. Function scanf
dusya [7]

Answer:

Option A

Explanation:

Because each function has specific amount of space allocated by default on the stack, so it cares about the length of the array being printed by it. By default the space is up to 100 kb but this size can be increased by setting it manually.

Option B is correct answer because scanf takes input from user until first space is hit.

6 0
4 years ago
Two technicians are discussing engine valve timing. Technician A says that the optimum valve timing is found through experimenta
nordsb [41]
The answer is B. A only. The optimum valve timing is found through experimentation using an engine dynamometer. The timing of the opening and closing of the valves is called valve timing. So the use of dynamometer measures the power output of a machine that is why it can measure the optimum valve timing.
7 0
3 years ago
Read 2 more answers
The _____ lists all of the fields that are available in a table.
crimeas [40]

What are the other options? Is this multiple choice or just fill in the blank

7 0
3 years ago
Other questions:
  • Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet. Which function should Jim use to fin
    11·2 answers
  • Is a ryzen 5 3600 and a gtx 1660 super a good combo? ​
    13·1 answer
  • Write a function checkPalindrome that accepts a single argument, a string. The function should return true (Boolean) if the stri
    15·1 answer
  • Once the human body stops moving in a crash, the internal organs stop as well. True or false?
    11·1 answer
  • If a fuse block or holder has tree fuses, it may be termed a...
    7·1 answer
  • What keyboard functions lets you delete words
    9·2 answers
  • There are 2048bytes in4megabytes true or false​
    10·1 answer
  • Which letter shows the ball when it has the maximum kinetic energy
    15·1 answer
  • B. Directions: Fill in the blanks with the correct answer.
    13·1 answer
  • URGENT! Drag the tiles to the correct boxes to complete the pairs.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!