What is the output of the following program

#include

int toronto (int x)

{

int w;
if (x == 0) w = 1; else w = toronto (x-1);
return (w);
}
int main (void)
{
int a = 2;
printf ("%d", toronto (a));
return (0); }

a. 0
b. 1
c. 2
d. -1
e. none of these

Answers

Answer 1

Answer:

The output is 1

Explanation:

Analysing the flow of program (We start from the main method)

The main begins here

int main (void) {

This line declares a as integer and also initializes it to 2

int a = 2;

This line passes 2 to the function names toronto and also prints the result of the function

printf ("%d", toronto (a));

return (0); }

The toronto function begins here.

Note that the function receives 2 as its argument and this is saved in variable x

int toronto (int x) {

This declares w as integer

int w;

If x is 0, w equals 1

if (x == 0) w = 1;

If otherwise

else

This reduces x by 1 and performs a recursion

w = toronto (x-1);

return (w);

}

Because of the structure of the if condition in the toronto function, the function will be repeated until x is 0.

And when x = 0; w = 1

This returns w (i.e. 1) back to the main function where 1 is printed as the output

return (w);


Related Questions

we need to send 254 kbps over a noiseless channel with a bandwidth of 15 khz. how many signal levels do we need

Answers

Answer:

The level of the signal is 353.85

Explanation:

Data rate determines the speed of the data transmission.

The data rate depends on the following factors

The available bandwidthnumbers of signal levelsthe quality of the channel ( Means the level of noise )

The data is transmitted either from a noiseless channel or a noisy channel.

The given quality of the channel in the question is noiseless.

Use the following formula to calculate the signal levels

Bit rate = 2 x bandwidth x [tex]Log_{2}[/tex] ( signal level )

where

Transmitted Data = 254 kbps = 254,000 bps

Bandwidth = 15 khz = 15,000 hz

Placing values in the formula

254,000 = 2 x 15,000 x [tex]Log_{2}[/tex] ( L )

254,000 = 30,000 x [tex]Log_{2}[/tex] ( L )

254,000 / 30,000 = [tex]Log_{2}[/tex] ( L )

8.467 = [tex]Log_{2}[/tex] ( L )

L = [tex]2^{8.467}[/tex]

L = 353.85 levels

Which 2 problems does the Pay down credit card workflow solve for clients? (Select all that apply) It helps clients stay on top of making payments on time It ensures that payments to credit card accounts are categorized correctly It provides a lower rate than most credit cards to qualified small businesses It uses language that non-accountants can understand

Answers

Answer:

B. It ensures that payments to credit card accounts are categorized correctly

D. It uses language that non-accountants can understand

Explanation:

Pay down credit card workflow is a new feature that makes entering records in QuickBooks easier for users. The two prime benefits of this workflow are;

1. It ensures that payments to credit card accounts are well categorized well. Without this feature, users most times find it difficult to enter records correctly or they tend to duplicate entries. This new feature obtains vital information that helps the software to correctly credit the accounts.

2. It uses language that non-accountants can understand. This simplifies the process and makes it easier for the user to enter the right data that would help the software to correctly credit the accounts.

Identify and give the application of the following operators.

(a) / (b) //​

Answers

Answer:

This answer depends on what language you're using, but in most languages, "//" is used to precede a one-line remark. "/" is used to divide a number by the other.  For example:

// this is a remark

var foo = x / y;

There are exceptions to both, although the / is almost universally used for division.  One exception would be assembly of course, I don't know if there are any higher level languages that don't use the slash.

please help me



Match the technology with the appropriate task.



1. graphics software

2. word processor

3. CAD

4. laptop

5. GPS​

Answers

Complete Question:

Match the technology with the appropriate task.

Column A

1. Graphics software

2. Word processor

3. CAD

4. Laptop

5. GPS

Column B

A. Create a company logo.

B. Get directions to a customer’s office.

C. Type a report.

D. Complete many types of tasks on a computer away from the office.

E. Design a building.

Answer:

1. A

2. C

3. E

4. D

5. B

Explanation:

1. Graphics software: it can be used to create a company logo. Some examples of software applications or programs are Adobe photoshop, Core-draw, illustrator etc.

2. Word processor: it is typically used for typing a text-based document. For instance, type a report. Some examples are notepad, Microsoft Word, etc.

3. CAD: design a building. CAD is an acronym for computer aided design used for designing the graphical representation of a building plan. An example is Auto-CAD.

4. Laptop: complete many types of tasks on a computer away from the office. A laptop is compact and movable, so it can be easily used in any location.

5. GPS: directions to a customer’s office. GPS is an acronym for global positioning system and it is typically used for locating points and directions of a place.

Answer:

1. A

2. C

3. E

4. D

5. B

How many minutes are there from 8:00 am to 1:00 pm?

Answers

Well it’s 5 hours so you take 5 times 60m for each hour and you get 300m

Answer:300 minutes

Explanation:

from 8 to 1 is 5 hours so you do 5*60= 300

list the difference between sdram and dram​

Answers

Answer:

i need this for a challenge

Explanation:

A counter is ?

A. used only outside of the loop

B. none of the above

C. a variable used in a loop to count the number of times an action is performed

D. A person with a pen and paper

Answers

Answer: In digital logic and computing, a counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship to a clock. The most common type is a sequential digital logic circuit with an input line called the clock and multiple output lines.

Which are the steps in the process of creating a database

Answers

Answer:

Determine the purpose of your database. ...

Find and organize the information required. ...

Divide the information into tables. ...

Turn information items into columns. ...

Specify primary keys. ...

Set up the table relationships. ...

Refine your design. ...

Apply the normalization rules.

Answer:

identifying fieldnames in tables

defining data types for field names

Explanation:

sorry I'm late. future Plato users this is for you

Fix the infinite loop so that it counts from 3 down to 1.public class Loop1{public static void main(String[] args){int x = 3;while (x > 0){System.out.println(x);}}}

Answers

Answer:

Include x-- right after the print statement

Explanation:

Given:

The above lines of code

Required

Edit to countdown from 3 to 1

The above code (as it is) prints 3 in infinite times. To make it countdown to 1, we simply include a decrement operation.

Initially, the value of x is 3: int x = 3;

And the condition is that the loop is to be repeated as long as x > 0

All we need to do is to include x-- right after the print statement.

This  operation will reduce the value of x on every iteration as long as the condition is true.

Hence, the complete code is:

public class Loop1{

   public static void main(String[] args){

       int x = 3;

       while (x > 0){

           System.out.println(x);

          x--;

       }}}

what security issues could result if a computer virus or malware modifies your host file in order to map a hostname to another IP address

Answers

Answer:

Man-in-the-middle attack

Explanation:

In this type of attack, the hacker uses the virus or malware to get and change his IP address and hostname to match the address and hostname of the target host computer. The allows the hacker to gain access to information sent to the target IP address first.

. Else-if is good selection statement that help us to solve problems in C++,mostly times same problem of same nature can also be solved via switch statement. Which one you prefer to use and why?

Answers

Answer:

Else-If statements

Explanation:

Personally, I prefer using Else-If statements for conditional statements since you can start with and If statement and add to it if necessary. Aside from this, Else-If statements also allow you to add more than one condition to be met by using tags such as and or and not. Switch statements are better in scenarios where you have a set of possible inputs or results and need a specific event to happen for each input/result, but this is not as common of a scenario so Else-If is usually my go-to conditional statement.

Which statement is true for rapid prototyping? (A. It creates a two-dimensional model of a part or a product, from the original model of the product.) (B. It is also known as 2D printing.) (C. It helps to avoid costly mistakes by allowing corrections early in the production process.) (D. It is also referred to as layered modeling.) ​

Answers

Answer:

C: It helps to avoid costly mistakes by allowing corrections early in the production process.

Explanation:

Remember, a prototype refers to an early sample or model of a product that is designed to test and figure out a concept or process.

The Rapid prototyping process has many advantages, besides being faster with the use of 3D dimensional technology, it allows for easy corrections of design/modeling errors early in the production process.

Answer:

C.

Explanation:

Plato

Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outpu

Answers

Answer:

Explanation:

The following program is written in Java and is a function that asks the user for an input and keeps doing so until a negative value is entered, in which case it calculates the average and max values and prints it to the screen.

public static void average () {

                       int num;

                       int sum = 0;

                       Scanner in = new Scanner(System.in);

                       System.out.println("Enter Number");

                       num = in.nextInt();

                       int count = 0;

                       int max = 0;

                       while(num >= 0)

                       {

                               sum+=num;

                               System.out.println("Enter Number");

                               num = in.nextInt();

                               count++;

                               if(num>=max){

                                       max = num;

                               }

                       }

               System.out.println(sum/count);

               System.out.println(max);

               }

Answer:hi

Explanation:

rheumatoid arthritis is caused when​

Answers

Answer:

caused by the immune system attacking healthy body tissue.

Explanation:

all though they are not sure what triggers it

The _____ Tag surrounds all content that will be visible on your web page for all to users to see on that website.

Answers

Answer:

The body tag

Explanation:

HTML has several tags; however, the tag that handles the description in the question is the body tag.

It starts with the opening tag <body> and ends with closing tag </body>

i.e.

<body>

[Website content goes in here]

</body>

Any text, image, object etc. placed within this tag will be displayed in the website

What is the BCC feature used for?

to format email message text in a custom font
to format email message text in a blind font
to send a courtesy copy of an email to someone who does not need to take action
to send an email to someone without revealing that person’s email address to others on the distribution list

Answers

Answer:

to send an email to someone without revealing that person’s email address to others on the distribution list

Explanation:

BAM

To send an email to someone without revealing that person’s email address to others on the distribution list.

What is BCC?

"Blind carbon copy" is referred to as BCC. BCC is a similar method to CC for forwarding copies of an email to additional recipients. When CC is used, a list of recipients is shown; when BCC is used, a list of recipients is not visible.

Because the other receivers won't be able to see that the email has been forwarded to another person, it is known as a blind carbon copy.

Carbon copy is referred to as a "CC" in email communication. When there was no internet or email, you had to sandwich a piece of carbon paper between the paper you were writing on and the paper you wanted to use as your copy in order to make a copy of the letter you were writing.

Therefore, To send an email to someone without revealing that person’s email address to others on the distribution list.

To learn more about BCC, refer to the link:

https://brainly.com/question/29398332

#SPJ6

NEED HELP 100 POINTS FOR ANSWER AND BRAINIEST!!! Which comparison operator is used to signify that a value is not equal to another value?
<>
<<
>=
=

Answers

Answer:

We use SQL Not Equal comparison operator (<>) to compare two expressions. For example, 10<>11 comparison operation uses SQL Not Equal operator (<>) between two expressions 10 and 11

Explanation:

<> operator is used to signify that a value is not equal to another value , Option A is the correct answer.

What are Comparison Operators ?

An operator used to compare or relate the value of two number or string is called a Comparison operator.

The value of 0 or 1 is returned on using Comparison Operators.

<> , Not equal to operator signifies that the value are either greater than or less than the other value but not equal in any case.

Therefore <> operator is used to signify that a value is not equal to another value.

To know more about Comparison Operators

https://brainly.com/question/15260168

#SPJ2

If an insurance policy covers individual losses up to $10,000 and has a deductible of
$500, the insured will be paid how much in the event of a covered loss of $5,000?

Answers

Answer: $4500

Explanation:

The deductible is the amount that the insured that is, the policy holder will have to pay. In this case, there is a covered loss of $5000 and the insured has a deductible of $500.

Therefore, the amount that the insured will be paid will be the difference between $5000 and the deductible of $500. This will be:

= $5000 - $500

= $4500

What will the output of the statements below? System.out.println(9%2); System.out.println(12%6); The output of the first statement is * The output of the second statement is​

Answers

Answer:

You get Exact 30 print of that sentence on a comadore 64

Explanation:

Just simple basic science. hope this helps

please help me please help me.​

Answers

Answer:

dont know man thanks for points tho

but it is 209

Explanation:

java Elements in a range Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain fewer than 20 integers. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a comma, even the last one. The output ends with a newline. Ex: If the input is: 5 25 51 0 200 33 0 50 then the output is: 25,0,33, (the bounds are 0-50, so 51 and 200 are out of range and thus not output). To achieve the above, first read the list of integers into an array.

Answers

Answer:

The program in Java is:

import java.util.Scanner;

public class MyClass {

   public static void main(String args[]) {

     Scanner input = new Scanner(System.in);

     int n;

     n = input.nextInt();

     int [] mylist = new int[n+1];

     mylist[0] = n;

     System.out.print("List elements: ");

     for(int i = 1;i<n+1;i++){

         mylist[i] = input.nextInt();

     }

     int min,max;

     System.out.print("Min & Max: ");

     min = input.nextInt();

     max = input.nextInt();

     

     for(int i=1; i < mylist.length; i++){

         if(mylist[i]>=min && mylist[i]<=max){

             System.out.print(mylist[i]+" ");

 }

}

   }

}

Explanation:

This line declares length of list

     int n;

This line gets length of list

     n = input.nextInt();

This line declares the list/array

     int [] mylist = new int[n+1];

This line initializes the element at index 0 to the length of the list

     mylist[0] = n;

This prompts user for elements of the list/array

     System.out.print("List elements: ");

The following iteration gets list elements

     for(int i = 1;i<n+1;i++){

         mylist[i] = input.nextInt();

     }

This declares the lower and upper bound (min, max)

     int min,max;

This line prompts user for elements of the list/array

     System.out.print("Min & Max: ");

This next two lines get the bound of the list/array

     min = input.nextInt();

     max = input.nextInt();

The following iteration prints the elements in the range

     for(int i=1; i < mylist.length; i++){

         if(mylist[i]>=min && mylist[i]<=max){

             System.out.print(mylist[i]+" ");

 }

}

1.in 3 sentences explain briefly what are the examples of the advantage of using multimedia approach in a slide presentation brainly​

Answers

Multimedia Presentations is very essential in making slide presentation because:

it makes the presentation colorfulIt is often purpose driven andIt challenges one and all listeners to think creatively

Some advantages of Multimedia includes

Oresentations made are concise, rich and makes one to develop confidence in language skills.They captivate audience to visualize what is been taught.

Multimedia agent includes video podcasts, audio slideshows etc. The use of the multimedia in presentation is also very good and user-friendly. It doesn't take much energy out of the user, in the sense that you can sit and watch the presentation,

Conclusively, It uses a lot of the presenters senses while making use of multimedia such as hearing, seeing and talking.

Learn more from

https://brainly.com/question/19286999

A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one child class (subclass) C) A class cannot have a parent class (superclass) D) A class cannot have a child class (subclass) E) A class can have multiple parent classes (superclasses)

Answers

Answer:

The answer is A)

Explanation:

In programming languages like java you can only use single inhertance meaning a class can only inherit attributes from one class. But in other languanges like C you can have multiple inhertance

True or false: In relational databases, each individual space within a row or column contains exactly one value.

Answers

Answer:

True.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores. This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.

Basically, when a database management system (DBMS) receives data update requests from application programs, it simply instructs the operating system installed on a server to provide the requested data or informations.

A relational database can be defined as a type of database that is structured in a manner that there exists a relationship between its elements.

Hence, in relational databases, each individual space within a row or column contains exactly one value.

Which of the following methods can be used to solve the knapsack problem?

a. Brute Force algorithm
b. Recursion
c. Dynamic programming
d. All of the mentioned

Answers

Answer: D. All of those mentioned

Explanation:

The knapsack problem is a problem that typically occurs in combinatorial optimization and is also a 2D dynamic programming example.

We should note that all the methods given in the option such as recursion, brute force algorithm and dynamic programming can all be used to solve knapsack problem.

Therefore, the correct answer is D.

Universal Container wants to understand all of the configuration changes that have been made over the last 6 months. Which tool should an Administrator use to get this information

Answers

Answer:

Set up audit trail

Explanation:

The administrator should set up an audit trail in order to get this information.

An audit trail would give him the record of all the configuration changes that have been made in a file or a database in the last 6 months.

Audit trails can be manual or electronic. It provides history and also documentation support. It can authenticate security and also help to mitigate challenges.

discuss how sentiment analysis works using big data?

Answers

Answer:

sentiment analysis is the process of using text analytics to mine various of data for opinions. often sentiment analysis is done on the data that is collected from the internet & from various social media platforms.

Other Questions
help with this please A mixture of ethyne gas (C2H2) and methane gas (CH4) occupied a certain volume at a total pressure of 16.8 kPa. When the sample burned, the products were CO2 gas and H2O vapor. The CO2 was collected and its pressure found to be 25.2 kPa in the same volume and at the same temperature as the original mixture. What percentage of the original mixture was methane Whats the answer giving brainliest HELP!!!!! There are 2 genes that decide each of your traits, and those 2 genes are always exactly alike. True or false? Shane made a scale drawing of a house and its lot. The scale he used was 1 inch : 3 feet. Inthe drawing, the backyard is 11 inches wide. What is the width of the actual yard? HELP PLEASE SUE TODAY Sunflower we haved renewed your helper thank you with working with our business Please help me!! I really need some help ASAP please Which expression is equivalent to - 2/3 (6x + 15) ?A. 4x + 10B.4x 10C.-4x - 10D.- 4x + 10 Find the value of x in rectangle BCDE.Find Value of x. Only answer if you know Find ,giving your answer correct to 3 significant fig where necessary a. 60%of 850 HELP HELP PLEASE!! SUPER CONFUSED! Which statement correctly defines a metaphor? Can y'all answer this please and thank you Geometry Ill mark brainiest crown thing only for the correct answer tho MOON The expression gives the weight of an object on the Moon in pounds with a weight of w pounds on Earth. What is the weight of a space suit on the Moon if the space suit weighs 178.2 pounds on Earth? Suppose a stock has an initial price of $71 per share, paid a dividend of $1.75 per share during the year, and had an ending share price of $88. Compute the percentage total return. 60% of what number is 880? The weight of an object is different on each planet becauseO mass changes with locationO each planet has a different force of gravityO each planet is a different distance from the sunOmass of the object changes on each planet