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
Select the correct answer from each drop-down menu.
tia_tia [17]

Answer:

<dd> tag is used

Explanation:

The <dd> tag is used in HTML document to explain set of terms. The <dd> tag list is used in conjunction with the <dl> term. Inside a <dd> tag we can insert text, sentence, paragraph or links. There are 4 primary tags to build any website. Every HTML document begins and ends with HTML tag.

6 0
3 years ago
g Points The critical section cannot be executed by more than one process at a time. false true Save Answer Q3.28 Points The cod
Ira Lisetskai [31]

Answer: Hello your question lacks some details attached below is the missing detail

answer :

a) True , B) False  C) True  D) True

Explanation:

a) True ; The critical section cannot be executed by more than one process at a time

b) False : The code does not satisfy the progress condition, because while loops are same hence no progress

c ) True :  The code satisfies the bounded waiting condition, because of the waiting condition of the while loop

d) True : No matter how many times this program is run, it will always produce the same output, this is because of the while loop condition

7 0
3 years ago
What is meant by Program Memory is paged?
atroni [7]

Answer:

Program memory is paged, this statement is defined as in a computer system paged memory is the process of allocation of memory and storing a portion of a process of execution. Page is a unit of logical memory in a program. It follows the process of paging, as it is a method of writing an information and reading the output from the storage drive. The main advantage of this process is that it become easy to swap because everything is the same size.

7 0
3 years ago
Can someone please tell me how to download tor browser onto a Linux laptop?
marta [7]

Answer:

Use windows

Explanation:

7 0
3 years ago
When looking at a program board at the end of program increment (PI) planning, what does it mean when a feature is placed in a t
IRISSAK [1]

Answer:

It simply means that other teams can independently complete the feature.

Explanation:

PI or program increment is a planning interval during which an agile release train (ART) plans and produces working and tested software and systems. It takes a duration of 8 to 12 weeks

Agile teams can access and independently complete various ARTs found in their swim lanes with no strings.

3 0
2 years ago
Other questions:
  • If you were optimizing for performance and wanted to support potentially adding many new elements to an adt, then:
    12·1 answer
  • _____ is when a person connects their location to photos that are posted online.
    5·2 answers
  • Give an example of a language L such that |L|=5 and |L^2|=16.
    5·1 answer
  • A(n) ________ operator, such as the greater than or less than symbol, can be used in a query criterion to limits the results pro
    12·2 answers
  • Can i edit my name on this app?
    7·1 answer
  • What is the purpose of a report?
    6·2 answers
  • What makes manually cleaning data challenging?
    15·1 answer
  • How many people are in Siver, on the game Valorant?
    14·1 answer
  • If you need to multiply 50 and 8 and divide by 2, what would you type on the numerlc keypad?
    10·1 answer
  • Which feature of cryptography is used to prove a user's identity and prevent an individual from fraudulently reneging on an acti
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!