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
alukav5142 [94]
2 years ago
6

Write a function that receives two numbers, m and n and calculates and displays the sum of the integers from m to n. For example

, if the arguments are m = 3 and n = 7, the function should calculate 3 + 4 + 5 + 6 + 7
Computers and Technology
1 answer:
Evgesh-ka [11]2 years ago
7 0

Answer:

The program to this question as follows:

Program:

//header file

#include <stdio.h> //defining header file

void inc(int m,int n) //defining method inc

{

   int sum, i; //declaring variable

   sum=m; //holding value of m variable

   for(i=++m;i<=n;i++) //loop for calculate number between given range  

   {

   sum=sum+i; //adding value

   }

   printf("sum of the integer is : %d",sum);//print value

}

int main() //defining method

{

   int m,n; //defining integer variable

   printf("Enter m value: "); //message

   scanf("%d",&m); //input value by user in variable

   printf("Enter n value: "); //message

   scanf("%d",&n);//input value by user in variable

   inc(m,n); //calling method

   return 0;

}

Output:

Enter m value: 3

Enter n value: 7

sum of the integer is :25

Explanation:

In the above code, an "inc" function is declared, that accepts integer parameters that are "m and n", inside the method two integer variable "sum and i" is declared, which is used in the loop.

  • The loop uses the user parameter to count value and uses the sum variable to calculate there sum.
  • In the main method, two integer variable n and m are declared, which take value from the user end, and at the last, we call the inc method, that prints sum value.
You might be interested in
Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVC
sergij07 [2.7K]

Solution :

A friend of mine have an old version of computer PC having the following components :

Input devices

Model name of the keyboard -- PUNTA , model number -- P-KB515

Model name of the mouse -- PUNTA, model number -- P-KB515

Output devices

Speaker : COMPAQ

Monitor : ACER,  Model Number  --- EB192Q

Storage : 500 MB capacity hard disk

RAM : 2 GB

Processor : Intel Pentium dual E1260 at the rate 1.80 GHz

It is provided with audio jacks

5 0
2 years ago
Jeremy is working with a team that is creating an application using attributes and associated methods. What type of programming
Ugo [173]
<span>object-oriented programming languages</span>
8 0
2 years ago
The OSI model is a useful tool in troubleshooting a network because it enables you to isolate a problem to a particular software
lutik1710 [3]

Answer:

1)  Layer 4, transport

2) Layer 2, datalink

3) Layer 5, session

4) Layer 7, application

Description of Problems are as below:

1) One of your servers has been exhibiting sluggish network performance. you use a network-monitoring program to try to evaluate the problem. You find considerable TCP retries occurring because the server is being overwhelmed by data, and packets are being discarded.

2) You check some statistics generated by a network-monitoring program and discovers that an abnormally high number of CRC errors were detected. (Hint think of the cause of CRC errors).

3) A user is trying to connect to another computer, but the logon attempt is continually rejected.

4) You try to access a Linux server to share files by using NFS. You can communicate with the server, but the shared files don't appear to be available.

Explanation:

OSI Model is a reference model to determine how applications communicate over a network. OSI consists of seven layers, and each layer performs a particular network function. The seven layers are:

   Layer 7 - Application.

   Layer 6 - Presentation.

   Layer 5 - Session.

   Layer 4 - Transport.

   Layer 3 - Network.

   Layer 2 - Data Link.

   Layer 1 - Physical.

1) One of your servers has been exhibiting sluggish network performance. you use a network-monitoring program to try to evaluate the problem. You find considerable TCP retries occurring because the server is being overwhelmed by data, and packets are being discarded.

Layer 4, transport

2) You check some statistics generated by a network-monitoring program and discovers that an abnormally high number of CRC errors were detected. (Hint think of the cause of CRC errors).

Layer 2, Data Link

3) A user is trying to connect to another computer, but the logon attempt is continually rejected.

Layer 5, session

4) You try to access a Linux server to share files by using NFS. You can communicate with the server, but the shared files don't appear to be available.

Layer 7, application

7 0
3 years ago
When you pass an array as an argument to a function, the function can modify the contents of the array?
taurus [48]
In most languages. Primitive data types ( char, int, float, bool, maybe string ) are usually passed by value, but compound data types are passed by reference, so you're not working on a copy but on the original.
8 0
2 years ago
If you want to insert a column into an existing table what would you do
Amiraneli [1.4K]
This is generally the same on Docs and Word. You'd just highlight the table, go into the settings, and expand it by one column, on docs by dragging it out a little more on the given grid.
Hope this helps!
5 0
2 years ago
Other questions:
  • Natural selection is a. how systems of rewards increase desired behaviors. b. the idea that the observable environment affects b
    6·1 answer
  • Which of the following are valid values for a boolean value in programming? (Select all that apply)
    8·1 answer
  • How to stay organized in an online school?
    7·1 answer
  • What does the binary odometer show about representing large numbers​
    15·1 answer
  • Why do people still use Intel HD graphics for gaming?
    8·1 answer
  • When you press the ____ key without entering any text after the automatic bullet character, Word turns off the automatic bullets
    11·1 answer
  • Any please answer this How much resistance is required to gen-erate 50 mA of current from a 5 volt bat-tery?
    5·1 answer
  • In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
    10·1 answer
  • Is this statement true or false? Title text boxes on every slide must be the same format. True false.
    8·2 answers
  • How many MB are there in 1000 KB?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!