Skip to content

CoreTask#5: DigitSum - Submit Your Code in Comment Section #30

@ErSKS

Description

@ErSKS

CoreTask#5: DigitSum - Write a function named isDigitSum that returns 1 if sum of all digits of the first argument is less than the second argument and 0 otherwise. For example isDigitSum(32121,10 ) would return 1 because 3+2+1+2+1 = 9 < 10. More examples: isDigitSum(32121,9) returns 0, isDigitSum(13, 6) returns 1, isDigitSum(3, 3) returns 0 The function should return -1 if either argument is negative, so isDigitSum(-543, 3) returns -1. The function signature is int isDigitSum(int n, int m)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions