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
Blizzard [7]
3 years ago
10

Write a recursive function sumAll that accepts an integer argument and returns the sum of all the integers from 1 up to the numb

er passed as an argument. For example, if 50 is passed as an argument, the function will turn the sum of 1, 2, 3, 4, ..50.
Computers and Technology
1 answer:
slavikrds [6]3 years ago
8 0

Answer:

int sumAll(int n)//function definition.

{

   if(n==1)//if condition.

   return 1;

   else//else condition.

   {

       return n+sumAll(n-1);//return the value and call the function in recursive manner.

   }

}

Explanation:

  • The above-defined function is a recursive type function that is written in the c language, which holds the if and else condition.
  • When the user passes the largest value from 1, then the else condition will be executed which adds the largest value and pass the value after the decrement of the value as an argument.
  • When the value will become 1, then the function if-block will be executed which returns the value and ends the calling function recursively.
You might be interested in
a. Write a function called fizzbuzz. This function will take 1 number as a parameter. The function will print all numbers from 0
OLga [1]

Answer:

def fizzbuzz (num):

 for item in range(num):

   if item % 2 == 0 and item % 3 == 0:

     print("fizzbuzz")

   elif item % 3 == 0:

     print("buzz")

   elif item % 2 == 0:

     print("fizz")  

   else:

     print (item)

fizzbuzz(20)

Explanation:

Using Python programming Language

Use a for  loop to iterate from 0 up to the number using the range function

Within the for loop use the modulo (%) operator to determine divisibility by 2 and 3 and print the required output

see attached program output screen.

5 0
4 years ago
What is the definition of delimited text?
Dmitriy789 [7]

Answer:

A delimited text file is a method of representing a table of data in a text file using characters to indicate a structure of columns and rows. This is typically used to provide an import/export function for services, software and databases that represents data in a neutral format. The following are common types of delimited text file. Hope this helps!

6 0
4 years ago
Read 2 more answers
Ginny faced an application error while executing the recorder in opera. Which web browser is generally recommended to use with r
NemiM [27]

Internet Explorer 9+ is the web browser recommended to use with recorders.

<h3>What is a web browser?</h3>

Anywhere on the internet is reachable with a web browser. It pulls data from other websites and shows it on your smartphone or computer. The HTTP Send Standard, which outlines how text, pictures, and audio are communicated on the web, is employed to transfer the data.

As we know,

Recorders are perfect for desktop applications because they can record a variety of items, including mouse clicks, scrolling, radio buttons, list boxes, checkboxes, and drop-down menus.

Thus, Internet Explorer 9+ is the web browser recommended to use with recorders.

Learn more about the web browser here:

brainly.com/question/19459381

#SPJ4

6 0
1 year ago
Dawn is trying to find out how much weight she can push across the room. She is really trying to find her __________. A. flexibi
Marrrta [24]

<em>The correct answer is d. muscular strength.</em>

<em></em>

<em>Explanation :</em>

<em></em>

<em>The maximal force a muscle can create when it contracts is referred to as muscular strength. When compared to someone with lower physical strength, someone with better muscular strength can lift heavier weights. Lifting progressively larger weights over time and eating a diet rich in protein-based foods can help a person's physical strength gradually grow.</em>

<em></em>

<em>I hope this helps. Please mark "Brainliest" if you can.</em>

8 0
2 years ago
Given a sorted list of integers, output the middle integer. assume the number of integers is always odd.
Svetllana [295]

integer userInput

integer i

integer mid

integer array(20) number

userInput = 1

for i = 0; userInput >= 0; i = i + 1

  if number[i] > -1

     userInput = Get next input

     number[i] = userInput

i = i - 1

mid = i / 2

if i > 9

  Put "Too many inputs" to output

elseif i % 2 == 0

  Put number[mid - 1] to output

else

  Put number[mid] to output

4 0
2 years ago
Other questions:
  • Write a SELECT statement that returns an XML document that contains all of the invoices in the Invoices table that have more tha
    8·1 answer
  • What are 3 characteristics of syndrome E?
    13·1 answer
  • What is the lowest layer of the osi model at which wired and wireless transmissions share the same protocols?
    11·1 answer
  • What standard linux utility is used to install and configure software on centos operating systems?
    8·1 answer
  • Can someone tell me how to use the Human machine language for beginners? or websites I should use.​
    7·1 answer
  • What is a GUI?
    11·1 answer
  • java A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "n
    5·1 answer
  • The following code will not compile. Which of the options below would allow the code to compile and run as intended?
    9·1 answer
  • The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c
    6·1 answer
  • Write and test a program that computes the area of a circle. This program should request a number representing a radius as input
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!