Write a program that lets a user enter n and that outputs n! (meaning n*(n-1)*(n-2)*...*2*1). hint: initialize a variable totalvalue to n, and use a loop variable i that counts from n-1 down to 1.

Answers

Answer 1
//  This code snippet calculates n! and stores the answer in the variable p.
// Handle 0! = 1 separately.
if (n==0) {
   p = 1;
}
else {
// Initialize p = n
p = n;

// While loop
while (n>1) {
      p = p*(n-1);
      n = n-1;
     }
}


Related Questions

When we use electricity to power our electronics, what other two, less useful, forms of energy often result

Answers

Answer:

heat and light

Explanation:

An important result of the development of anesthesia was?
1.a decreased rate from disease & accidents
2.an increase number of amputations
3. A decrease in the number of surgical procedures performed
4.an increase in the need for healthcare

Answers

It could be #2 since the patient would be asleep under the anesthesia they would be able to perform amputations more often since the patient would not be able to feel the pain during the procedure. It could also be #3 because if the patient is asleep you could use a more direct approach instead of avoiding certain procedures that would put the patient in a lot of pain if it was performed while they were awake. In all I would say the answer is #2, please comment which is the right answer, thank you.

What bit position in an ascii code must be complemented to change the ascii letter represented from uppercase to lowercase and vice versa?

Answers

Flip bit position 5 to accomplish this. This maps to hex value 0x20, where the least significant bit is assumed to be at position 0.

Example: ascii "A" = 0x41, "a" = 0x61.  0x41 xor 0x61 = 0x20.

You would implement a flip function by XOR'ing the character value with 0x20.

Final answer:

To change an ASCII character from uppercase to lowercase or vice versa, the 6th bit from the right should be flipped. This bit manipulation directly affects the letter's case in the ASCII code representation.

Explanation:

To change an ASCII letter from uppercase to lowercase or vice versa, you need to complement (flip) the 6th bit position. In the binary representation of ASCII codes, changing the state of the 6th bit (counting from the right, starting at position 1) alters the case of the letter. For instance, the ASCII code for 'A' is 01000001, and flipping the 6th bit results in 01100001, which is the ASCII code for 'a'. This principle applies to all alphabetical characters in the ASCII table, illustrating a simple yet effective method for changing letter case programmatically.

This concept is not only limited to ASCII characters but can also extend into more complex encoding schemes and cryptographic applications where binary manipulation plays a crucial role. The ability to understand and manipulate bit positions is fundamental in areas involving data encoding, transmission, and security.

After creating the table, how would you add a new record to the table

Answers

Assuming you have a SQL database, you would use the SQL INSERT statement.

A car with a 20-gallon gas tank averages 23.5 miles per gallon when driven in town and 28.9 miles per gallon when driven on the highway. write a program that calculates and displays the distance the car can travel on one tank of gas when driven in town and when driven on the highway

Answers

Highway: 
cout << "The car can drive " << 20*26.8 << " miles on the highway." << endl; 
Town: 
cout << "The car can drive " << 20*21.5 << " miles in the town." << endl;

Final answer:

On a 20-gallon tank, the car can travel approximately 470 miles in town with an average of 23.5 miles per gallon, and approximately 578 miles on the highway with an average of 28.9 miles per gallon.

Explanation:

To calculate the distance a car can travel on one tank of gas when driven in town and on the highway, we can use the formula: Distance = Number of gallons × Miles per gallon. In this case, the car has a 20-gallon gas tank. When driven in town, the car averages 23.5 miles per gallon, and on the highway, it averages 28.9 miles per gallon.

Distance Calculation in Town

In town distance = 20 gallons × 23.5 miles per gallon = 470 miles

Distance Calculation on the Highway

Highway distance = 20 gallons × 28.9 miles per gallon = 578 miles

Therefore, the car can travel approximately 470 miles in town and 578 miles on the highway on a single tank of gasoline.

Henri is working in a complex financial spreadsheet that has hundreds of columns of data. If he is at column AN and would like to return to the first row of the first column, what key combination should he press?

Control + Tab
Shift + Tab
Control + Home
Shift + Home

Answers

Answer: Contro; + Home

This key combination will return you to the first row, first column of the current worksheet.

Answer:

C. Control+Home

Explanation:

Can I please have brainliest??

What is the term used to describe a file that data is read from?

Answers

A file from which data is read is a .doc file.

It’s important to consider adjusting a user’s social network permissions (or access) because

Answers

You may not want to share access to social networks with other members of your team. Also you may want to adjust your users social permission for security reasons, just to be on the safe side. A stronger network means you have a lower chance of a hacker breaking through your system.

What is the length of time an ip address is assigned to a switchport called?

Answers

What is the length of time an IP address is assigned to a switch port called? Aging Time

Having the most up-to-date web browser can: A Increase your browser speedB Allow you to view the most up-to-date version of websitesC Increase your online securityD All of the above

Answers

The answer is D: All of the above

You connect three 0.5 volt lights in series. Each light has a resistance of 25ohms. Answer the following.

Answers

1. 3 times the light voltage, ie., 3*0.5 = 1.5V
2. Total R = 3*25 = 75Ω, V=1.5V, I = V/R = 1.5/75 = 20 mA
3. A 1.5V battery (e.g., an AA battery) with a charge of at least 20mAh. AA batteries should be able to handle this easily.

The final element of an e-mail message should be

Answers

jQuery is the final element of a e-mail message I believe

The default and “hidden” boolean operator in a standard google search is

Answers

The default Boolean operator in any search engine is OR.

The default and “hidden” Boolean operator in a standard Google search is “”AND OPERATOR””

Further Explanation

Boolean Operators are words or symbols used as conjunctions to combine or exclude keywords in a search. Using these operators, you are able to focus your search on the results that will be most helpful. Google also has a few additional operators that work to refine results.

AND

Limit results Vegetarianism AND obesity  

(Search for content that contains both vegetarianism and obesity.)

AND Operator

Use AND searches in Google to search for all the search terms you specify. It's helpful to use AND when you want to make sure that the topic you're researching is the topic you get in the search results. As an example, say you search the word Amazon on Google. The results most likely show you things on Amazon.com, like the homepage of the site, its Twitter account, Amazon Prime information and other things you can buy on Amazon.com.

However, if you were instead looking for information on the Amazon rain forest, even searching for Amazon rain forest might give you results that are only about Amazon.com or the word Amazon in general. To make sure each search result includes both the words Amazon and rain forest, use the AND operator.

Examples:

● Amazon AND rain forest

● sausage AND biscuits

● news AND war AND president

In each of these examples, search results include web pages with all the terms connected by the Boolean operator AND.

Learn more:

What is a boolean search?

         brainly.com/question/1084252

Keywords: google search, AND operator, Amazon, logical operator, Boolean operators

propose,two new ,proudly South African ways,which you can visualize that the IoT,can be used at work to make life better.

Answers

1. Internet should be used as a medium of learning.

Through internet, such African people could obtain a lot of knowledge from various fields that provided by more developed countries, and use that knowledge to help the development in south africa.

2. It should be used for utilizing business.

There are a lot of new potential business that could be done because of internet, such as blogging, affiliate marketing, public endorsement through social media followers, etc.

At intersections, especially during inclement weather, the BEST way to ensure other drivers see you is to:

Answers

Keep your lights on

exterior brick veneers are used to support the entire weight of the roof structure

Answers

Final answer:

Exterior brick veneers are not meant to support the weight of a building's roof; structural components like buttresses and iron rods bear the weight and provide stability, especially in large structures with heavy roofs.

Explanation:

The discussion about exterior brick veneers and other structural elements relates to architectural engineering principles. Specifically, it indicates that exterior brick veneers are not the main structural components supporting the weight of a building's roof. Instead, other structural components such as buttresses and iron rods are used to counteract the lateral forces and the downward pressure on the walls, which helps to stabilize larger structures with stone vaulting or heavy roof structures. These elements allow for the distribution of weight and forces to prevent collapse and provide stability to buildings with large spans or heavy loads. This incorporates understanding of materials such as wood, stone, and brick, and how they interact with architectural elements like buttresses, piers, colonettes, and masonry walls.

Final answer:

Exterior brick veneers are typically non-structural cladding and do not bear the weight of roof structures. Structural support is usually provided by internal elements such as load-bearing walls, columns, and buttresses, which counter lateral forces. Modern construction techniques, like steel exoskeletons, also highlight the aesthetic versus structural roles of components.

Explanation:

The statement concerning exterior brick veneers suggests a misunderstanding of their structural role in architecture. Typically, exterior brick veneers do not support the entire weight of a roof structure; instead, they serve as a non-structural cladding. The actual weight of the roof is usually borne by structural elements such as columns, beams, and load-bearing walls. In historical construction, additional support was often provided by architectural features such as buttresses, which countered the lateral forces of the vaulted ceilings, allowing for the stability of the structure as well as the inclusion of large windows for light.

As an example, in the construction of large edifices during certain historical periods, the stability of the structure against the outward thrust of the roof required solid walls and piers. Iron rods were sometimes incorporated as a tension element to counteract this force. Furthermore, implementations like mullions can provide structural support while allowing for larger windows, enhancing the delicate appearance of the masonry.

In modern construction, methods such as a steel exoskeleton are utilized to support innovative forms such as the rotated rhomboid shape of the Soumaya Museum. This method allows the weight of the building to be supported by an external framework rather than by the brickwork itself, which further illustrates the distinction between structural and aesthetic components of a building.

To insert clip art into a document, what step should I take immediately after i find the clip art I want to insert?

a. Use scroll bars to view more choices of clipart.
b. Click on the clip art image.
c. Click on the clip art button.
d. Click insert tab at the top of the screen.**

Answers

B becuse you need to add it to the computer
b because you need to add it

A(n) ________ is installed on your computer, and when the program is opened, your e-mail is downloaded to your computer. web-based e-mail e-mail client e-mail host e-mail server

Answers

I believe the answer may be a web-mail program.

Final answer:

An e-mail client is software installed on your computer to manage email without the need for a web browser, such as Microsoft Outlook or Mozilla Thunderbird. It communicates with an e-mail server to send and receive messages, which can be accessed with a username and password. Client software for emails is crucial for offline access and organization of messages.

Explanation:

A e-mail client is installed on your computer, and when the program is opened, your email is downloaded to your computer. Unlike web-based email, which operates through a browser, an e-mail client is a program that manages your emails directly from your computer’s operating system. This type of software allows you to access your messages offline and typically offers features for organizing and archiving your emails. Popular examples include Microsoft Outlook and Mozilla Thunderbird.

Using an e-mail client involves having a username and a password for logging into the e-mail server, which is where your emails are initially received and stored. The e-mail client acts as a bridge between the e-mail server and your personal device and enables the process of sending and receiving messages.

Software and hardware play essential roles in this process, with the client software installed on devices like PCs and laptops, and e-mail servers potentially being housed in data centers. Analysis of data software can be used to enhance the experience by providing additional layers of information management and security.

A. which chip is thought to be the first microprocessor? how many transistors roughly did it use?

Answers

A micro processor is an integrated circuit that have all the functions of a central processing unit of a computer.
The chip which is thought to be the first microprocessor is INTEL 4004. It was manufactured by Intel in 1971. Intel 4004 has 2,300 transistors. 

Life insurance _____. covers hospital bills pays for repairs on cars pays a certain sum of money to a beneficiary in case of death covers the costs associated with life

Answers

It pays a certain sum of money to a beneficiary in case of death

Answer:

B Pays a certain sum of money to a beneficiary in case of death

Explanation:

got it right

wubba lubba dub dub wub wub wub

Answers

What is Rick Sanchez
I am in great pain, please help me.

Making small talk at a meeting is a bad idea because

Answers

It waste a tremendous amount of time
The term "small talk: is used to describe an informal talk and type of conversation about unimportant or uncontroversial matters most commonly used in some social gatherings. Meeting on the other hand is formal gathering that needs to follow predefined structure and where conclusions about some subject should be gained. This is the reason why small talk is bad idea at a meeting. 

The sequence of folders to a file or folder is called a(n) ________

Answers

path. In *nix the dirname command can be used to isolate it.

what is the maximum number of communication paths for a team of twenty people?

Answers

Each of the 20 people has 19 other people to communicate to. If you add that all up you get 20*19 paths, but then each path is counted twice (back and forth), so we divide this by 2. 20*19/2 = 190.

The general forumula is n(n-1)/2

When you right click a word with a red squiggly line under it, which of the following displays?

Answers

Final answer:

When you right click a word with a red squiggly line under it, a list of suggestions or options to correct the spelling or grammar mistake displays.

Explanation:

When you right click a word with a red squiggly line under it, the following displays: a list of suggestions or options to correct the spelling or grammar mistake.

For example, in Microsoft Word, when you right click a word with a red squiggly line, a context menu appears with suggestions such as 'Ignore All', 'Add to Dictionary', 'AutoCorrect', and a list of possible correct spellings.

This feature is helpful in identifying and correcting spelling or grammar errors in a document.

A system with two dual-core processors has four processors available for scheduling. a cpu-intensive application is running on this system. all input is performed at program start-up, when a single file must be opened. similarly, all output is performed just before the program terminates, when the program results must be written to a single file. between startup and termination, the program is entirely cpubound. your task is to improve the performance of this application by multithreading it. the application runs on a system that uses the one-to-one threading model (each user thread maps to a kernel thread). ⢠how many threads will you create to perform the input and output? explain.

Answers

The controlling thread is all that is needed for I/O in this case. What you've described, although multi-threaded, is a classic IPO (Input, Processing, Output) program.

1 what is the osi security architecture

Answers

The osi security architecture focuses on security attacks, mechanisms, and services.


When searching for a video file on your computer you should look for a file with which extension

Answers

There are many extensions for video, but common ones are .mp4, .mov .flv avi, and .wmv

Answer and explanation:

Video files have different extensions. The difference between one and another relies on image quality, video options -such as subtitles or different languages, and the player used to open the file. Among the diversity of video file extensions, we can find MP4, MOV, WMV, FLV, AVI, and AVCHD.

What is the name given to software that provides the interface between the os and computer hardware?

Answers

Driver.



----------------------------------------------

________ to a base class may be assigned the address of a derived class object.

Answers

fed jig. defect bhds. if. bugs. bffs. hex.

Answer:

Pointers to a base class may be assigned the addres of a derived class

Other Questions
which word best describes how macbeth is portrayed at the beginning of the play?A. HeroicB. Silly C. CowardlyD. Romantic What caused the taino population on hispaniola to drop from 500,000 to a few hundred by 1542? If an employee owes $250 for payroll taxes, how much will the employer need to pay for payroll taxes? why are regular visits to the doctor important for maintaining your optimal immune health? Two non-perpendicular, non-bisecting, intersecting line segments definition The weight of a small bag of sugar is 2.265 kg. the student is baking cakes for a college scholarship fundraiser. it takes 100 grams of sugar to make one small cake. how many cakes can be made from a single bag of sugar? Revenue xls en excel Match each word with the correct meaning of its bolded prefix, root, or suffix.A) forewarnedB) bakeryC) gratefulD) magnanimousrelating to, place where -> ____great-> ____before, in time-> ______please-> ______ what is the primary purpose of most constitutions Why is it impossible to contain gaseous iron in a glass container? Help Pre calc! Identify the x values for which f(x) >- 2 I think the answer would be -2 What is the slope of the line that passes through the points (-3,-3) And (-9,5) ? PLEASE HELP A paperweight in the shape of a rectangular prism is shown: A right rectangular prism is shown with length 10 cm, width 4 cm, and height 4 cm. If a cross section of the paperweight is cut perpendicular to the base, which shape describes the cross section? Parallelogram Triangle Square Hexagon For safety. the recommended height of a zebra fence is 5 ft. Because of uneven ground surfaces, the actual height of the fence can vary from recommendation by 3 inWrite and solve an absolute value equation to find the maximum and minimum heights of the fence. Then, find the maximum and minimum heights of the fence The skin condition caused by hyposecretion of the oil glands and is an inherited condition is known as The "fight-or-flight" response is associated with the _____ division. The power of the federal government began to expand after 1933 in response to WHAT IS A TONE IN MUSIC THAT HAS A DEFINITE PITCH CALLED Civilizations were held together largely by force." do you agree with this assessment or were there other mechanisms of integration as well? In considering the level of assistance a client needs, the agency will: Steam Workshop Downloader