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]
3 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]3 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
What are the different between Facebook and LinkedIn
DIA [1.3K]
Face you can talk to friends post picture's and see pictures of friends i am not really sure what is linkedln
7 0
3 years ago
Read 2 more answers
The ________ is the easy way to insert a new slide between existing slides.
Tema [17]
What is the subject about?
7 0
3 years ago
Define additional characteristics such as font weight or style for an html tag
Bas_tet [7]
<span>Define additional characteristics such as font weight or style for an html tag:
- attributes</span>
4 0
2 years ago
The accounting department moved its network-attached printer from one side of the office to a more centralized location, making
Blababa [14]

Answer:

The cable run connecting the new keystone jack to the patch panel is bad.

The patch panel connector for the new location's cable run is not connected to a switch.

Explanation:

The cable run connecting the new keystone jack to the patch panel is bad.

The patch panel connector for the new location's cable run is not connected to a switch.

5 0
3 years ago
How can i save a word 2016 document as a word 2016 document?
Lana71 [14]
Type 2016 document.pdf.files
3 0
3 years ago
Other questions:
  • EBay buyers voluntarily comment to other users and sellers on the quality of service, promptness of shipping, and their general
    5·1 answer
  • Given a int variable named yesCount and another int variable named noCount and a char variable named response, write the necessa
    9·1 answer
  • A. True
    5·1 answer
  • to the nearest millimeter a cell phone is 123 long and 54 mm wide what is the ratio of width to length
    12·1 answer
  • Which guideline should you use when downloading software from the Internet?
    15·1 answer
  • The World Wide Web is full of unstructured data. Search engines like Google, Bing and Yahoo have been doing a good job of allowi
    6·1 answer
  • Why does dew form on grass overnight
    7·1 answer
  • JAVA NEED HELP ASAP
    7·1 answer
  • Which of the following situations is least likely fair use
    6·2 answers
  • Please help me please it's urgent​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!