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
AnnyKZ [126]
3 years ago
15

Practice problems on functions. Write C function(s) to carry out the specified tasks. For each problem, also write the suggested

application program(s) that apply the function. (1) Write a function multiPrint(int n, char c) that prints n copies of a character c.
Computers and Technology
1 answer:
scoray [572]3 years ago
3 0

Answer:

Function:

int fun(int n,char c) // function definition with a two argument in which variable n is a integer type and variable c is a character type.

{

   while(n>0)// while loop

   {

       printf("%c",c); // print statement for character

       n--; // decrease statement to false the loop.

   }

   return 0; //return statement.

}

output:

  • When the user pass n=5 and c='a', it will prints 5 times 'a' character.
  • When the user passes n=10 and c='t', it will print 10 times 't' character.

Explanation:

  • Firstly we declare a function of two arguments in which variable n is an integer type and variable c is a character type.
  • Then in the function body, we use while loop from n times iteration because question demands to print n time any character.
  • Then in the loop body, we use a print statement to print a character and a decrease statement to false the loop after a finite iteration.

You might be interested in
Mechanisms that combine memory, processing speed, and knowledge to regulate the analysis and flow of information within the info
gizmo_the_mogwai [7]

Answer:

control processes.

Explanation:

Mechanisms that combine memory, processing speed, and knowledge to regulate the analysis and flow of information within the information-processing system are referred to as executive/control processes.

3 0
3 years ago
Describe the difference between the while loop and the do-while loop.
Karo-lina-s [1.5K]

Answer:

The difference between While loop and Do - While loop are explained below.

Explanation:

  • While loop : It is a looping procedure in which the statements inside the while loop are executed depending on the condition outside the while before starting the loop.
  • If the condition is true then the code inside loop is executed otherwise not.
  • Do - While loop:  It is a looping procedure in which the statements inside the loop get executed and then the condition at the end of the loop is checked.
  • This means even the condition is fails the statements inside the loop are executed once.
  • Do while loop name itself suggests that "do the while and then check the condition".  
7 0
3 years ago
Describe some common types of charts.​
Mekhanik [1.2K]
Bar chart.
Pie chart.
Line chart.
4 0
2 years ago
Read 2 more answers
Question 1 (True/False Worth 15 points)
liraira [26]

It is a programmer's responsibility to contribute to society and human well-being is true.

Explanation:

  • It is a programmer's responsibility to contribute to society and human well-being is true.
  • The Association for Computing Machinery (ACM) is known as  the world's largest educational and scientific computing society.
  • It has its own Code of Ethics and another set of ethical principles which were also approved by the IEEE as the known standards of teaching and practicing software engineering.
  • Programmers contribute to develop computer systems which can reduce negative impression to the society.
  • The negativity includes as threats to safety and health, which can be reduced and make everyday activities and work easier.
  • software developers should reduce the risk of harming others due to the coding errors or the security issues which could impact human well-being.

3 0
3 years ago
Name the tools in plant propagation.<br>Q<br>18.<br>16.<br>17.<br>19.<br>20.<br>please po asap​
Agata [3.3K]
16. Branch or tree cutter
17.paint tape
18. Knife
19. Pots
20. Waterer
6 0
2 years ago
Other questions:
  • Ideation includes all of the following EXCEPT
    5·1 answer
  • What is software that, while purporting to serve some useful function and often fulfilling that function, also allows Internet a
    11·1 answer
  • From the standpoint of the governing bodies of .com, why is it important that owners of individual domains maintain authoritativ
    5·1 answer
  • Suppose that a system uses 32-bit memory words and its memory is built from 16 1M × 16 RAM chips. How large, in words, is the me
    11·1 answer
  • What is the purpose of the making of Nintendo Switch?
    10·2 answers
  • At each layer of the OSI model, data is appended to the original message and then sent on to the next lower layer. What is this
    10·1 answer
  • This assignment will again take the form of a compare/contrast essay. You will use the fresco of Christ Teaching the Apostles in
    14·1 answer
  • Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right or left. Initially, the bu
    7·1 answer
  • Dante needs to query a table to find all the references to a particular product and apply a 10%
    7·2 answers
  • A construction-based client would like to develop an application that can analyze an image of machinery and overlay information
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!