Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mike likes to use _(underscores) and ! (exclamation points) in his written communications. Write a program characters.c that computes the number of underscores and exclamation

Mike likes to use _(underscores) and ! (exclamation points) in his written communications. Write a program characters.c that computes the number of underscores and exclamation points in an input sentence. The program should include the following function. Do not modify the function prototype.

void count(int* num_, int* num_exclamation);

The count function asks the user to enter a sentence. Use getchar() function (getchar() is covered in chapter 7) to read in the input. The user input ends with the user pressing the enter key (a new line character).

The count function takes two parameters of int *. The num_ parameter points to a variable in which the function will store the number of underscores. The num_exclamation parameter points to a variable in which the function will store the number of exclamation point.

The main function calls the count function. It should also contain the printf statements that display the result.

Example input/output: Enter a sentence: _Hi_there!!! Output: There are 2 underscores and 3 exclamation points in the sentence.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

What is the use of bootstrap program?

Answered: 1 week ago

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago