Computer Science, asked by amisha55, 1 year ago

write an algorithm to enter any two numbers and print their multiplication and product


aishwaryash321: I am writing this code in java
Pseudo: ok

Answers

Answered by Pseudo
61
Algorithm to multiply two numbers in C:

1) Start

2) Accept Number one

3) Accept Number two

4) Multiply both the numbers

5) Print the result.

6) End

Answered by ashutoshmishra3065
2

Answer:

Explanation:

Two-number multiplication algorithm in C:

  • 1) Start
  • 2) Accept Option 1
  • 3) Accept Option 2.
  • 4) Multiply the two figures.
  • 5. Print the outcome.
  • 6. End

Algorithm to enter any two numbers and print  their multiplication and product:

  • How many is the first one?
  • Which number comes next?
  • To obtain the result, multiply them now.
  • Print the first number, a *, the next number, a =, and finally the product.

A set of instructions that guide you through a procedure step by step is all that an algorithm is.

Programming languages make an effort to provide you with a practical vocabulary for telling a computer how to carry out an algorithm utilizing the computer processors, which essentially only do very simple math operations on a sequence of switches that can be ones or zeros.

However, an algorithm is independent of any one programming language.

Algorithm to multiply two numbers using stack overflow:

  • We need to multiply the two numbers x and y, however the * operator is not an option.
  • The addition of x and y, or the addition of y and x, is a straightforward and linear method.
  • The second method is to choose any number, such as x, and check to see if all of its bits are set. If so, proceed as follows:
  • Product is initially 0;
  • apply product +=y<<i  to all i.

It is obvious that the loop runs 32 times for 32-bit values and that its time complexity is constant.

#SPJ3

Similar questions