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
andriy [413]
4 years ago
11

Write a MATLAB code which asks a user for an integer number and computes the factorial of that number. Use while loop to create

the code.
Computers and Technology
1 answer:
ivann1987 [24]4 years ago
7 0

Answer:

my_int=input('Enter an integer to calculate its factorial: ');

i=1;%Counter to the while loop

r=1;%To keep the result

while i<=my_int

   r=r*i;

   i=i+1;

end

display('The result is:')

r

Explanation:

The factorial is the multiplication of all positive integers from 1 to n , my_int is the value of n in the program, in a while loop you need a condition that is met until all the positive integers have been multiplied, i is the counter that allows this (starts has one and is increasing by one till it gets the value of n)  and also is useful to make the multiplication and r keeps the result of each step until the condition stop being met and then the program the program leaves the loop and displays the solution.

You might be interested in
Which actions did Sheila have to take to make the changes observed? Check all that apply.
Harrizon [31]

Answer:

Use

Explanation:

Out line view

6 0
3 years ago
Write a program to change background colour of your visual basic form with any 3 different events.​
Stels [109]

Answer:

To change the background color, select the form in Visual Studio and locate the BackColor property in the Properties panel. There are a number of ways to specify a color. Color by name - Simply type in a color name into the BackColor value field (for example Red, Yellow, Cyan etc).

Explanation:

4 0
3 years ago
Read 2 more answers
. What process skill would a scientist use to find the length of a line
Brilliant_brown [7]

Answer:

Explanation:

A ruler

;););););););););););););););)

7 0
3 years ago
Samantha received a gaming session as a gift. She would like to have it communicate with her sister Jennifer’s gaming system so
WARRIOR [948]

Answer:

Wi-Fi Direct

Explanation:

Wi-Fi Direct is a Wi-Fi standard for peer-to-peer wireless connections that allows two devices to establish a direct Wi-Fi connection without an intermediary wireless access point, router, or Internet connection.

3 0
3 years ago
Which of the following attacks is MOST likely the cause when a user attempts to go to a website and notices the URL has changed?
lilavasa [31]

Answer: C) DNS poisoning

Explanation: DNS poisoning or DNS cache poisoning is the type of attacking tendency towards the URL of the computer. These attempt to attack the URL using the spam mails and the user usually end up clicking on the URL provided by the attacker which invokes attack in the computer.

This mechanism takes place in the emails as well as the selected websites which can be accessed by the users easily.These attacks once enter the system seems like the real thing and become prone to many risks .

6 0
3 years ago
Other questions:
  • A number of related records that are treated as a unit is called
    6·1 answer
  • Assuming a computer has a single processor and a single core with no support for parallel execution, explain why running a multi
    11·1 answer
  • Using the Sakila database, create a query that displays the film title, description, as well the actor first and last name for a
    12·1 answer
  • 6, Answer the following questions.0<br>a What is software?​
    5·1 answer
  • In an URL what does the domain name describe?
    14·1 answer
  • What are the steps to open the Custom AutoFilter dialog box?
    5·2 answers
  • What is the missing part to have the output as 3 2 1 while count &gt;0 : print(count) count -= 1
    10·1 answer
  • Demons I shall be your eternal nightmare
    13·1 answer
  • The three main objectives of information security are
    5·1 answer
  • Online activities among businesses
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!