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
OverLord2011 [107]
3 years ago
11

Write a recursive function to compute sum of first N integers starting with 1.

Computers and Technology
1 answer:
Citrus2011 [14]3 years ago
4 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// recursive function to find sum from 1 to n

int recur_Sum(int n)

{ // base condition

if (n <= 1)

 return n;

// recursive call

return n + recur_Sum(n - 1);

}

// main function

int main()

{

   // variables

   int n;

   cout<<"Enter a number:";

   // read the number

   cin>>n;

   // print the sum

   cout<<"Sum of first "<<n<<" integer from 1 to "<<n<<" is:"<<recur_Sum(n);

return 0;

}

Explanation:

Read a number from user and assign it to variable "n".Call function recur_Sum() with parameter "n".This function will recursively call itself and find the Sum of first n numbers from 1 to n.Then function will return the sum.

Output:

Enter a number:10

Sum of first 10 integer from 1 to 10 is:55

You might be interested in
Research at least two articles on the topic of managerial issues of a networked organization. Write a brief synthesis and summar
maw [93]

Answer:

Explanation below

Explanation:

Network organisations are those that is of a legal entity or independent company or a subsidiary business unit. These organisations can be an internal business unit acting as separate profit centres or a stable company that has outsourced its work.

Synthesis:

According to the articles "The top 3 network management challenges" and also "Problem Management in the Networking Environment" is that managerial issues like the problem diagnosis method itself can engage various stakeholders whose deeds need to be coordinated as well as tracked to confirm that the cost of study itself does turn into an issue along with that resolutions to problems are really discovered. An association expects its network to be  reliable, secure, flexible, expandable and cost-effective.

Relation:

Network security has had to adapt increasingly quickly, in order to keep up with the new ways that users and back-end systems work. Networks are growing not just in complexity, but also in size. As more and more functions converge onto data networks, the number of devices attached to the network grows, and therefore the number of switching and routing nodes in the network must also grow.Organizations need to attach more and more of their operations onto the data network – remote locations need connections into central sites; even locations with no staff need network links for surveillance cameras and/or environmental monitoring, and/or control of automated devices. An effective problem management is needed to handle the issues.

An effective problem management requires the integration of a number of different process groups and the ability to effect change in both the infrastructure and organizational behavior. Implementing a problem management strategy that achieves these goals needs careful planning and long-term commitment. Using external supplier relationships to make sure that the support required for both identifying problems and supporting the resolution is in place is also an integral part of the overall solution.

References: http://www.analytictech.com/mb021/virtual.htm

https://www.accyotta.com/assets/uploads/docs/Allied_-_AMF.pdf

7 0
3 years ago
So, I have strict parents &amp; need help, if u don’t know how to fix this after u read it, leave. I don’t want u getting points
nikklg [1K]

Well if you forgot your password you can click "Forgot Password" at the bottom and it should ask you some questions and send you an email with the password

8 0
3 years ago
Read 2 more answers
Why is monitor called softcopy output device?​
Mademuasel [1]

Answer:

A display device is the most common form of output device it presents output visually on a computer screen.the output appears temporarily on the screen and can easily altered or erased,it is sometimes referred to as softcopy

7 0
2 years ago
What is a web client ​
Anna [14]

Explanation: It's something like siri. It's a machine or technology inside a phone or computer that gives you information to a question that you asked.

5 0
3 years ago
Read 2 more answers
Systems such as smartphones, appliances, game controllers, cable set-top boxes and automobiles that contain small computers are
Setler [38]

I guess the correct answer is Embedded system.

Systems such as smartphones, appliances, game controllers, cable set-top boxes and automobiles that contain small computers are called Embedded systems.

8 0
3 years ago
Other questions:
  • Which term describes the order of arrangement of files and folders on a computer?
    11·1 answer
  • PLEASE HELP
    14·2 answers
  • The phrase has become an Internet buzz word. It refers to a top-level domain name for communications organizations.TrueFalse
    12·1 answer
  • The keyboard and the mouse____ parts of a computer ​
    8·1 answer
  • Most sus color in Among Us? Red is safe I saw him scan. I'll give brainliest because why not. I'm bored.
    14·2 answers
  • Write a loop to print 10 to 90 inclusive (this means it should include both the
    10·1 answer
  • Which of the following comments are correct? Select all that apply.
    14·1 answer
  • Lab 6B: printing a binary number
    13·1 answer
  • Could someone please help?​
    10·1 answer
  • How to set Campaign goals?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!