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
Which of the following methods is the easiest way to set up a VPN client on a computer for a user who is not technical?
Pie

Answer:

Option D.

Use CMAK to create an executable to install.

Explanation:

The CMAK is the Connection Manager Administration Kit it is a feature in Microsoft Windows that allows users to customize the remote connection experience for users on their network.

The CMAK can be simply used by the technical expert to remotely operate the client computer, and customize the VPN himself without the non-technical user having to do anything. This can be done for computers only on a network however.

3 0
3 years ago
How to scan a screenshot on Brainly?
yulyashka [42]

Answer:

You go to the option that says "snap to solve" an that's it

5 0
3 years ago
Read 2 more answers
In a relational database application, a(n) ________ key is used to link one table with another.
mr_godi [17]

In a relational database application, a <u>foreign key</u> is used to link one table with another.

<h3>What is a foreign key?</h3>

In database management system (DBMS), a foreign key can be defined as a column whose value provides a link between the data that are stored in a table or relational database.

This ultimately implies that, a <u>foreign key</u> is used to link one table with another in a relational database application.

Read more on keys here: brainly.com/question/8131854

#SPJ12

6 0
2 years ago
the outline view allows you to control how much information you can see in a document, because you can expand or collapse sectio
pochemuha
I believe its true because you can expand or collapse sections of it
5 0
3 years ago
A weak fuel to air mixture along with normal airflow through a turbine engine may result in?
Sladkaya [172]

Answer:

A weak fuel to air mixture along with normal airflow through a turbine engine may result in <u>a lean die out</u>.

Explanation:

Lean die out is a type of problem that may occur in the turbine. This may result in the weak fuel to air mixture. In case if the mixture of fuel and air is getting low due to some reasons like leakage of gas or low speed of engine may result in dangerous conditions such as fire or blast in the turbine. This is called lean die out. In the result of this problem, the turbine can be burn with the blast and may leads to causalities.

5 0
3 years ago
Other questions:
  • Binary is a sequence of 0s and 1s such as 1001101 which can be used to code information. To break a code, you need to find how m
    14·1 answer
  • Will a tablecloth that is 155 cm long cover a table that is 1.6 m long?
    12·2 answers
  • What are the names of the two main characters in pirates of silicon valley
    5·1 answer
  • 1. Write a program to input four numbers and store them in variables.
    6·1 answer
  • We can use formatting before and after typing.​
    8·1 answer
  • Which of the following statements is FALSE?
    5·1 answer
  • ____ Is an Internet service that allows users to send and receive short text messages In real time.
    10·1 answer
  • in python Write a program that prompts the user to enter a hex character and displays its corresponding decimal integer python
    14·1 answer
  • Write the function evens which takes in a queue by reference and changes it to only contain the even elements. That is, if the q
    6·1 answer
  • Write a statement that slices a substring out of the string quote and puts it into a variable named selection. If given the stri
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!