Computers and Technology

15.20 LAB: Count characters - functions 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. You may assume that the string does not contain spaces and will always contain less than 50 characters.

Ex: If the input is:

n Monday
the output is:

1
Ex: If the input is:

z Today is Monday
the output is:

0
Ex: If the input is:

n It's a sunny day
the output is:

2
Case matters. n is different than N.

Ex: If the input is:

n Nobody
the output is:

0
Your program must define and call the following function that returns the number of times the input character appears in the input string. int CountCharacters(char userChar, char* userString)

Note: This is a lab from a previous chapter that now requires the use of a function.
in C please

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, ayoismeisalex
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
image
Computers and Technology, 23.06.2019 04:31, Remba
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, arguellesjavier15
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
image
Computers and Technology, 23.06.2019 10:00, thezbell
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
Do you know the correct answer?
15.20 LAB: Count characters - functions Write a program whose input is a character and a string, an...

Questions in other subjects:

Konu
History, 12.03.2021 19:50