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]
3 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]3 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
Ken has discovered that a vice president of his company has been using his computer to send data about a new product to a compet
yaroslaw [1]
Report the person through proper channels
7 0
3 years ago
Similar to Wi-Fi, ____ is designed to provide Internet access to fixed locations (sometimes called hotzones), but the coverage i
andrew11 [14]

Similar to Wi-Fi, WiMAX is designed to provide Internet access to fixed locations (sometimes called hotzones), but the coverage is significantly larger.

<h3>What is WiMAX used for?</h3>

WiMax is know to be a full worldwide interoperability that is said to be made just for microwave access and this is said to be a form of a communication technology that was set up for wireless delivering of  high-speed Internet service to a lot of geographical areas.

Wi-Fi is also known to be a kind of a wireless technology that is often used to link up computers, tablets, and other devices to that of the internet.

Note that Wi-Fi is said to be a radio signal transmitted from a wireless router  and as such, Similar to Wi-Fi, WiMAX is designed to provide Internet access to fixed locations (sometimes called hotzones), but the coverage is significantly larger.

Learn more about Wi-Fi from

brainly.com/question/13267315

#SPJ1

8 0
2 years ago
Hola, alguien me puede ayudar¡¡¡¡¡¡¡¡¡¡¡¡
WARRIOR [948]
Hola<span>, </span>Alguien me<span> podría </span>ayudar<span> a realizar una buena sinopsis de la película "</span><span>Jardín de Amapolas" dirigida por Carlos Melo Guevara, gracias? i hope i helped you</span>
4 0
4 years ago
You must receive an invitation in order to join Pinterest. True or False?
malfutka [58]
That is false, Pinterest is a free website that anyone can join!
3 0
3 years ago
Read 2 more answers
A virus is a self-replicating program that produces its own code by attaching copies of it into other executable codes.
Allisa [31]

Answer: Stealth/Tunneling Virus

Explanation: Stealth or tunneling virus are the virus which are responsible for attacking a computer system which causes the problem in the functioning of the operating system by manipulating files, creating partition etc.

These viruses try to avoid or prevent the anti-virus scans for the detection any sort of virus or error . They act to prevent any malfunction detection by taking charge for the anti-virus operation.

5 0
3 years ago
Other questions:
  • The advanced boot options screen can be displayed by pressing what key during the boot sequence?
    6·1 answer
  • Suppose two hosts, A and B, are separated by 15,000 kilometers and are connected by a direct link of R = 5 Mbps. Suppose the pro
    11·1 answer
  • Write a program that uses an "if" statement to determine if the number is greater than one. If the number is greater than 1, the
    9·1 answer
  • Society that lives a nomadic life and relies on domesticated animals.
    6·1 answer
  • Nielsen purchases scanner data from retail transactions to track the sales of consumer packaged goods, gathered at the point of
    14·1 answer
  • Suppose users share a 1-Gbps link. Also, suppose each user requires 200 Mbps when transmitting, but each user only transmits 30
    5·1 answer
  • What is the purpose of the New Window command?
    7·2 answers
  • List the steps to create a new folder in windows
    13·1 answer
  • How have newspapers and magazines adapted to digital technology?
    14·1 answer
  • you're troubleshooting an ip addressing issue, and you issue a command to view the system's tcp/ip configuration. the command yo
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!