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
Which button could Pamela press in the Microsoft Word spell checker to make the word “colour” instantly change to “color” whenev
Savatey [412]
One step is to right click on the word to add it to her personal dictionary. or, <span><span>Press F7. Word starts the spelling and grammar checking utility. </span><span>Make corrections, as appropriate, when prompted.
</span></span>

However, one can create a macro that would do the conversions :

1) Identify a list of words whose spelling you want to convert.2) Turn on the macro recorder. 3) Use the Replace feature to replace the spellings.4) Turn off the macro recorder.

The macro will do a conversion from one to the other. Later, as we have more words that need to be automatically replaced, we can just edit the macro and add those words.

8 0
3 years ago
how to write a function "void funct()" which will accept a string from the user as input and will then display the string backwa
Mariulka [41]

Answer:

#include <bits/stdc++.h>

using namespace std;

void funct(){

   string name;

   cout<<"enter the string: ";

   cin>>name;

   

    reverse(name.begin(), name.end());

    cout<<"The string is : "<<name<<endl;

   

}

int main()

{

   funct();

 

  return 0;

}

Explanation:

create the function funct() with return type void and declare the variable type string and print a message for asking to used enter the string.  

The string enter by user is store in the variable using cin instruction.

after that, we use a inbuilt function reverse() which takes two argument.

firs argument tell the starting point and second index tell the ending point. then, the reverse function reverse the string.

name.begin() it is a function which return the pointer of first character of string.

name.end()  it is a function which return the pointer of last character of the string.

finally, print the reverse string.

for calling the function, we have to create the main function and then call the function.

5 0
3 years ago
A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
Vanyuwa [196]

Answer:

Three.

Explanation:

5 0
3 years ago
What is the difference between password protection and encryption? please answer quick, i cant pass this test for the life of me
sergiy2304 [10]

Answer:Password protection is like locking something in a safe-deposit. It means no one can get to the locked content without knowing the right combination. This method is used on separate documents, folders, and other data the computer's user may want to protect from other people who might have access to the device. The problem is, if someone interested in such content obtains the password or finds a way to open it without it, the content might be revealed despite the owner's efforts to keep it hidden. Unfortunately, there are a lot of ways hackers could obtain the password or hack in without it. For example, it could be obtained with the help of malware, or it might be guessed if the user chooses a weak password. Not to mention, when it comes to PDF documents, the passwords placed on them can be removed using the CMD window or specific.

Password encryption is a step up from password protection. The term can be a tad confusing because, in fact, you cannot encrypt the password itself. Instead, by setting up "password encryption" you are creating a password AND encrypting the contents of the file. In our example (see instructions below), the contents of the user's PDF document are not only password protected, but also encrypted. It is a process during which the content one wishes to keep secret is altered to make it unrecognizable. For example, if it is a text document, letters of each word might be shuffled with additional characters so the words would no longer make any sense. The reverse process is only available if the person who wants to decrypt this data can provide a specific decryption key or a password. In other words, even if the password is removed no one could read the hidden content as it still would need to be decrypted. Of course, it is important to realize you might be unable to retrieve it too if you lose the decryption key, aka, the password.



PLS MARK ME AS BRAINLIEST.

3 0
2 years ago
In microsoft word, when you highlight existing text you want to replace you are
RSB [31]
You are changing the word
8 0
3 years ago
Other questions:
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • a(n) ___ loop allows you to cycle through an array without specifying the starting and ending points for the loop
    14·1 answer
  • The memory unit of a computer has 2M Words of 32 bits (or 4 bytes) each. The computer has an instruction format with 4 fields: a
    14·1 answer
  • Use HTML to create a web page
    10·1 answer
  • Which two options are negotiated via ncp during the establishment of a ppp connection that will use the ipv4 network layer proto
    7·1 answer
  • What is something that can be done to help stop teen teen crashes
    8·1 answer
  • Why are the READ and DATA statements used<br>together?​
    10·1 answer
  • Write a python program that should determine from the range you choose to enter :
    9·1 answer
  • Whats your favorite .io game (example krunker.io, gawd.io)<br> (PS FWEE PTS BOIS)
    7·1 answer
  • Jim is working on a network design for a small office running a Windows file and printer server with Internet
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!