Computer Science, asked by rananya875, 1 day ago

Prepare a  flowchart and an  algorithm to check whether a given number is divisible by 7,​

Answers

Answered by ruddarpratap9
1

Answer:

bawisjsmmajskalsjkskskhe

z

Attachments:
Answered by MichMich0945
0

Logic:

  • If the mod of any num ( lets assume as n ) is 0, than n is divisible by 7. Or n is the multiple of 7.

Equation: n % 7 == 0

*Modulus operator returns the remainder of the calculation.

∵ 12 % 2 is  kinda the same as 12 / 2, the only difference is % will return 0 instead of 6.

Let me make it more clear for you

20 % 4 will return 0 ( stating that 20 is completely divisible by 4 ).

Q = 5, R = 0.

And,

20 / 4 will return 5 ( / operator returns the quotient )

Algorithm:

  1. Start.
  2. Accept n.
  3. if n % 7 = 0,
  4. Print "The given number is divisible by 7.
  5. else
  6. Print "The provided number is not divisible by 7".
  7. End.

Flowchart:

Attached in the attachments...

Hope this helps you <3

Attachments:
Similar questions