albert
albert

Reputation: 15

What is a 'large number, represented as an array of decimal digits'. Is it the sum of the numbers in the array?

Write a C function that returns 1 if a large number, represented as an array of decimal digits, is exactly divisibly by 7, otherwise 0. The number has n decimal digits.

int div7(int number[], int n)

That is the question.

Does he mean that I have to add the numbers in the array which is the 'large number'?

But it is also an int, so it wouldn't have decimal places?

Upvotes: 1

Views: 114

Answers (1)

Kevin
Kevin

Reputation: 76234

No, you shouldn't sum the numbers. The number 279 would be represented as {2,7,9}, for example. 279 is divisible by 7, but 2+7+9 isn't.

Upvotes: 3

Related Questions