Question: Please do the following in C programming. A) Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function

Please do the following in C programming.

A)

Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function prints a message to standard output depending on the value of its parameter.

If the parameter equals 1, the function prints disagree

If the parameter equals 2, the function prints no opinion

If the parameter equals 3, the function prints agree

In the case of other values, the function does nothing.

Each message is printed on a line by itself.

B)

Write the definition of a function dashedLine, with one parameter, an int.

If the parameter is negative or zero, the function does nothing. Otherwise it prints a complete line terminated by a new line character to standard output consisting of dashes (hyphens) with the parameter's value determining the number of dashes. The function returns nothing.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!