Question
please help me by matlab
5.2) Develop a program that prompts the user for three numbers. Once received, print the multiplication of the first two numb
0 0
Add a comment Improve this question Transcribed image text
Answer #1

vams. mx 1 format long 2 first = input(first :); $prompting inputs 3 second = input(second :); 4 third = input(third :)Commana window >> vams - first :3.3343 7 second :2 third : 4 Multiplication of two numbers is 6.6686>>||vams.mx vam2.mx 1 one = input(First number : ); $prompting inputs 2 two = input (Second number :); 3 opr = input(Enter op>> vam2 First number : 3.2 Second number :2.1 Enter operator :+ Addition 5.300 >>

source code:

format long
first = input('first :'); %prompting inputs
second = input('second :');
third = input('third :');
multiply = first * second;
fprintf('Multiplication of two numbers is %.*f',third,multiply);
% using third number as quantity of decimal places to pring

one = input('First number : '); %prompting inputs
two = input('Second number :');
opr = input('Enter operator :');
if( opr == '+') %checking with if statemets
disp(one+two);
elseif( opr == '-')
disp( one-two);
elseif( opr == '/')
disp( one/two)
elseif( opr == '*')
disp( one*two);
else
disp('Choose correct operator')
end

if you have any doubts ask me..

encourage me with your upvote..

Add a comment
Know the answer?
Add Answer to:
please help me by matlab 5.2) Develop a program that prompts the user for three numbers....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters...

    5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7, 2, bob, 10, and 4 and match the output below. ​ 1 largest = None 2 smallest = None 3 while True: 4...

  • You must write a C program that prompts the user for two numbers (no command line...

    You must write a C program that prompts the user for two numbers (no command line input) and multiplies them together using “a la russe” multiplication. The program must display your banner logo as part of a prompt to the user. The valid range of values is 0 to 6000. You may assume that the user will always enter numerical decimal format values. Your program should check this numerical range (including checking for negative numbers) and reprompt the user for...

  • Write a C++ program to take  two numbers as input from the user , compute the addition,...

    Write a C++ program to take  two numbers as input from the user , compute the addition, subtraction, multiplication and division of these numbers and display the desired formatted results.

  • Write an ARM program that implements a simple four-function calculator and prompts the user to enter...

    Write an ARM program that implements a simple four-function calculator and prompts the user to enter a pair of decimal integers (A and B) followed by a character that specifies one of the operators: ‘+’ for addition to compute A+B                             ‘-‘ for subtraction to compute A-B ‘*’ for multiplication to produce the product A*B ‘/’ for division to produce the quotient A/B. Input should be the pair of numbers followed by the operand followed by a return. For example...

  • MATLAB QUESTION 8) Create a program that first prompts the user to enter any two numbers....

    MATLAB QUESTION 8) Create a program that first prompts the user to enter any two numbers. Then prompt the user again to input as many numbers as they choose. Stop the program by inputting-1. Then, display the largest number and second largest number in the command window once the user kills the program. The built-in max function cannot be used. The figure below is an example of what the command window should look like when the code is ran. First...

  • Write a program that prompts the user to input three numbers

    Write a program that prompts the user to input three numbers. The program should then output the numbers in non-descending order

  • Write an ARM program that implements a simple four-function calculator and prompts the user to enter...

    Write an ARM program that implements a simple four-function calculator and prompts the user to enter a pair of decimal integers (A and B) followed by a character that specifies one of the operators: ‘+’ for addition to compute A+B                             ‘-‘ for subtraction to compute A-B ‘*’ for multiplication to produce the product A*B ‘/’ for division to produce the quotient A/B. Input should be the pair of numbers followed by the operand followed by a return. For example...

  • Prepare a MATLAB program (script file) that allows a user to enter two 4-element vectors and...

    Prepare a MATLAB program (script file) that allows a user to enter two 4-element vectors and scalar values to perform different mathematical (exponentiation, multiplication, and subtraction) operations on the elements within the originally entered vectors Moreover, the program also performs addition, dot product and element-wise multiplication of the two vectors.

  • Write a C program that asks the user to enter three numbers (integres). A menu will...

    Write a C program that asks the user to enter three numbers (integres). A menu will be displayed to let the user choose one of the three options: print the two highest numbers, product of the three numbers or the division of the second by the by the third if the third is not zero. See the sample runs. Required: Your code must use -One function to get the numbers from the user One function for each of the three...

  • 6. Consider a C program that reads two real numbers from the keyboard followed by a character where the character can b...

    6. Consider a C program that reads two real numbers from the keyboard followed by a character where the character can be one of the operators +,-, *, 1, or % providing the addition, subtraction, multiplication, division, or remainder respectively. Then the result is displayed on the screen For example, if the user types 2.0 3.0 % then your code will display: Note: In the above example the inputs are real numbers but the remainder only performs an integer operation....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT