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
fomenos
3 years ago
3

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 totalv

alue to n, and use a loop variable i that counts from n-1 down to 1.
Computers and Technology
1 answer:
uysha [10]3 years ago
3 0
//  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;
     }
}

You might be interested in
What is the primary difference between a Marketing Information System (MIS) and a Decisions Support System (DSS)? a. Cost of imp
SOVA2 [1]

A DSS uses software that allows managers to more fully utilize available information to assist in making decisions  is the primary difference between a Marketing Information System (MIS) and a Decisions Support System (DSS).

<h3><u>Explanation:</u></h3>

A management information system that helps the marketers in making important decisions that are related to the marketing fields refers to the marketing information system. It is the system where the information that are associated with the marketing will be gathered and analysed for making important decisions by the marketing managers.

The information system that helps an organisation in making important decisions are called as Decision support system. The main thing that differentiates MIS and DSS is that A DSS uses software that allows managers to more fully utilize available information to assist in making decisions.

8 0
3 years ago
You have implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts acces
yulyashka [42]

<u>Client-server</u> implemented a network where hosts are assigned specific roles, such as for file sharing and printing. Other hosts access those resources but do not host services of their own.

<u>Explanation:</u>

The client-server can be utilized on the web just as on a neighborhood (LAN). Instances of customer server frameworks on the web incorporate internet browsers and web servers, FTP customers and servers, and the DNS. Different hosts get to those assets yet don't have administrations of their own. Since it permits arrange permits numerous PCs/gadgets to interface with each other and offer assets.

5 0
4 years ago
Given the int variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another int variable m
Marysya12 [62]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int x=5,y=2,z=9;

   int min;

   // find the smallest value and assign to min

   // if x is smallest

   if(x < y && x < z)

   // assign x to min

    min=x;

     // if y is smallest

else if(y < z)

 // assign y to min

    min=y;

// if z is smallest

else

 // assign z to min

    min=z;

// print the smallest

cout<<"smallest value is:"<<min<<endl;

return 0;

}

Explanation:

Declare and initialize variables x=5,y=2 and z=9.Then check if x is less than y and x is less than z, assign value of x to variable "min" .Else if value of y is less than value of z then smallest value is y, assign value of y to "min".Else z will be the smallest value, assign its value to "min".

Output:

smallest value is:2

6 0
3 years ago
Music = ("rap", "hip hop", "gospel")
astraxan [27]
Music = (“rap”, “hip hop”, “gospel”)
Country = (“country”,) #make sure that comma is outside of quotes
New_music = music + Country
print(New_music)
#var can be whatever you want
output:
(“rap”, “hip hop”, “gospel”, “country”)
4 0
3 years ago
Pleas help I will give brainiest
stellarik [79]
1) A
2)D
3)C
4)A
5)D
Hope this will help u
5 0
3 years ago
Read 2 more answers
Other questions:
  • LAN security policies center on issues concerning connectivity; this includes determining how devices adhere to the network. Amo
    14·1 answer
  • The website of an international human rights organization stores a large database of information and provides search functionali
    15·1 answer
  • Which of the following is a job description for a person with a degree in Information Technology? radiology engineer web develop
    7·1 answer
  • A wired laser printer is attached to a home computer. That printer has been shared so that other computers on the home network c
    11·1 answer
  • Elisa and Josh need to access General Help. Elisa will press the F1 key. Josh will click on ? in the upper-right corner of the W
    14·2 answers
  • Untuk memberikan keterangan pada bagian bawah halaman dokumen yg akan diulangi pada setiap halaman dokumen yg digunakan fasilita
    8·2 answers
  • Tech Town has been hit with a bad storm and the town is suffering from severe flooding. The kids have no way to get to school.Te
    7·1 answer
  • A _____ is sent to companies that are hiring to get an interview. résumé brochure business report newsletter plz hurry need it n
    13·2 answers
  • What is the most appropriate data type for each of these items?
    15·1 answer
  • To read encrypted data, the recipient must decipher it into a readable form. What is the term for this process?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!