Computer Science, asked by premamaadireddy, 6 hours ago

draw a flow chart to input a number.Find it's square if the entered number is multiple of 10.If entered number if not a multiple of 10,then find its cube​

Answers

Answered by sanjaakash2008
1

Answer:

Given a positive number n, write a function isMultipleof5(int n) that returns true if n is multiple of 5, otherwise false. You are not allowed to use % and / operators.

Method 1 (Repeatedly subtract 5 from n)

Run a loop and subtract 5 from n in the loop while n is greater than 0. After the loop terminates, check whether n is 0. If n becomes 0 then n is multiple of 5, otherwise not.

Answered by shilpa85475
0

In order to calculate the multiple of 10 we will check the modulo of the number by 10 and then check if the modulo is equal to 0, then it is the multiple of 10.

Explanation:

1. Start.

2.take the input from the user as numbers as num;

3. if num%10==0 then

int square= num*num;

else

int cube=num*num*num;

4.Print the results according to the numbers.

5. Stop.

Similar questions