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]
2 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]2 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
Persons who have been given access to an installation can be counted on to be of no threat. true or false? (antiterrorism scenar
aliya0001 [1]
<span>The statement that "Persons who have been given access to an installation can be counted on to be of no threat" is false. If they are not honest enough, they could become the dangerous staff the company could ever had because he or she has access to everything, files, information, etc. That is why, in selecting a person to be trusted with such responsibility, he or she undergoes an intensive training.</span>
4 0
3 years ago
Help!! me!! plsssssssssssssssssssssssssssssssssss
Maslowich

Answer:

e,f,g, and h

Explanation:

5 0
2 years ago
If a clean install is performed on a hard drive with a previous install of windows and the drive is not re-formatted during the
Tpy6a [65]
Either wiped off the drive, or right next to the new ones, I do not recommend keeping the old files.
3 0
3 years ago
Which code snippet calculates the sum of all the even elements in an array values? Group of answer choices int sum = 0; for (int
olganol [36]

Answer:

The second one:

int sum = 0; for (int i = 0; i < values.length; i++) { if ((values[i] % 2) == 0) { sum += values[i]; } }

5 0
3 years ago
Protocol 2 - Check for Errors
Lapatulllka [165]

Please note that the Problem to be solved from Protocol 1 is not provided hence the general answers. To construct and send, open a network environment a single multi-packet message, simply click "Add Packet" and then click "Send at Once".

<h3>How will the receiver know the order of the packets or if any are missing?</h3>

If the text or message sent does not make any reading sense, or if certain words are jumbled and out of place, then it is clear that something is wrong.

If the messages arrive in a coherent fashion, then the packet was fully received.

<h3>How will the receiver request missed packets and what will the sender do in response?</h3>

Where the users are familiar with the Transmission Control Protocol, lost packets can be detected when there is a timeout. Lost packets are referred to as Dropped packets.

Learn more about Packets at:
brainly.com/question/17777733

7 0
1 year ago
Other questions:
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • You are preparing to program a replacement system board, but the "system is booting in mpm mode" message is not displayed. what
    10·2 answers
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • Can you please help on number 1 and 2?
    13·1 answer
  • Consider the following code segment.
    12·1 answer
  • What are the three control statements in Qbasic?​
    10·1 answer
  • In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said. slightly add someth
    14·1 answer
  • Create a file using any word processing program or text editor. Write an application that displays the files, name, containing f
    8·1 answer
  • Can some one help me with this please
    5·1 answer
  • Write a two to three sentence response to the following question:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!