write an algorithm to accept two numbers.If two numbers are equal then find the sum otherwise, the product
Answers
Answered by
47
Algorithm:
- start
- initialize two variables a,b as int
- input a,b, value from the user
- start if a is equal to b the initialize sum as int
- add a and b,store the value in sum variable
- print sum
- else initialize product as int
- multiply a with b and store the result in product variable
- print product
- end if condition
- end program
----Hope you got- what you wanted, if you liked my algorithm,mark as brainliest, it would really help me. :)
Answered by
6
Following are the steps of algorithm is required to accept two numbers and if they are equal then find the sum otherwise the product.
Algorithm:
- Start
- Initialize n1 and n2 as two integer variables.
- Accept the value of n1 and n2.
- check if
Initialize the sum as integer variable
print sum
- else
Initialize the product as integer variable
print product
- Stop
Similar questions
English,
6 months ago
Computer Science,
6 months ago
Physics,
6 months ago
Biology,
11 months ago
Chemistry,
11 months ago
Chemistry,
1 year ago
Social Sciences,
1 year ago