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
Get step-by-step solutions from verified subject matter experts
