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
3. What is a web directory? What are the key differences between web directories
MrMuchimi

Answer:

web directories are much smaller and more specific than search engines

3 0
2 years ago
Discuss all the features on 1-5th generation of computer​
stira [4]

Answer:

What is the features of fifth generation computer?

Fifth Generation Computers

In the fifth generation, VLSI technology became ULSI (Ultra Large Scale Integration) technology, resulting in the production of microprocessor chips having ten million electronic components. This generation is based on parallel processing hardware and AI (Artificial Intelligence) software.

5 0
2 years ago
System design is the determination of the overall system architecture-consisting of a set of physical processing components, ___
Alenkinab [10]

Answer:

C) Hardware, Software, People

Explanation:

System design is the determination of the overall system architecture-consisting of a set of physical processing components, Hardware, Software, People and the communication among them-that will satisfy the system’s essential requirements.

5 0
3 years ago
Read 2 more answers
Suppose that list is sorted using the selection sort algorithm as discussed in the book. What is the resulting list after two pa
MrRissso [65]

Answer:

The answer is "Option C".

Explanation:

In the given question the main list is missing. so, first, we defined the main list after that explain the answer to this question:

The main list:

list={24, 20, 10, 75, 70, 18, 60, 35}

In the above-given choices, option c is correct because in the list, the element 10 and element 18 are fixed in its correct position and element 10 and 24 are positioned in the placed of 18 elements, and the 20 elements will be placed as follows, and the other choices were wrong because in this data is in its wrong place.

4 0
3 years ago
Companies that have a well-established brand name or reputation in a particular line of business usually want the URLs for their
ICE Princess25 [194]

Answer:

The answer is "True"

Explanation:

In the web browser, when you type and search any name of the company or any brand name so, it will be given the full detail of the company or the specific brand, and it also provides the new collection of the brand. which allows you to buy the product online, that's why we use the URL, that reflects the reputation of a company or the brand.

4 0
3 years ago
Other questions:
  • Speech on inventors and inventions
    14·1 answer
  • to move from the second cell in the table in the accompanying figure back to the previous cell, press the ____ key(s)
    10·1 answer
  • In fiberoptic cable, the signal source is__________waves
    7·1 answer
  • in c Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the li
    14·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • Laser printers are particularly effective for printing _______________.
    6·1 answer
  • Consider the following code segment. for (int a = 0; a &lt; 10; a++) { for (int b = 10; b &gt; a; b--) { System.out.print("#");
    6·1 answer
  • Assessment timer and count Assessment items Item 6 How many different keys can be used in a single sort? 1 2 3 4
    14·1 answer
  • When approaching a bicyclist from the rear, you should slow down and
    8·1 answer
  • What is the output of the code? (CHECK IMAGE)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!