Question: C Programming Language The code below matches the sample input/output but is marked wrong. Are there other ways to do this problem? The focus is

C Programming Language

C Programming Language The code below matches the sample input/output but is

The code below matches the sample input/output but is marked wrong. Are there other ways to do this problem? The focus is on recursion and functions.

#include

int joCheck(unsigned long long int number)

{

if(number % 7 == 0 || number % 8 == 0)

{

return 1;

}

else return 0;

}

int main()

{

int cases = 0;

scanf("%d", &cases);

for(int i = 1; i

{

unsigned long long int number;

scanf("%d", &number);

if(joCheck(number) == 1)

{

printf("Case #%d: YES ", i);

}

else printf("Case #%d: NO ", i);

}

}

Jo Number Jojo likes Jo numbers. A Jo numbers are positive integers whose decimal representation contains only 7 and 8. For example, 8 and 778 are Jo while 18 and 286 are not. Jojo calls a number semi-Jo if it could be evenly divided by some Jo number. Given integer N, help him find out if it's an semi-Jo number Format Input The input begins with an integer T indicating the number of test cases. In each test case, there is an integer N, the number that needs to be checked Format Output For each test case, output YES if number N is semi-Jo. Otherwise, output NO Constraints 1N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!