Ask your own question, for FREE!
Computer Science 108 Online
OpenStudy (anonymous):

could some one please help me out with this code it says the function name is larger_remainder: (int, int, int) -> bool and the description is Return True if the remainder of the first integer when divided by the third integer is larger than the remainder of the second integer when divided by the third integer. Return False otherwise. pleaseee helppp

OpenStudy (anonymous):

Yes now what help you need......?

OpenStudy (anonymous):

Here is the function in pseudocode hope it helps: larger_remainder(a, b, c) { if ((a % c) > (b % c)) return true else return false; }

OpenStudy (anonymous):

what do you need to know is t the modulo operator?

OpenStudy (anonymous):

basically the function divides a by b a whole number of time to get the remainder, It also divides b by a and gets the remainder it then compares the remainders and returns TRUE if the remainder from a is bigger than then remainder form b i.e. 5 % 2 = 1 6%4 = 2 do you see

OpenStudy (anonymous):

In c language.. #include<stdio.h> #include<conio.h> #define true 1 #define false 0 int larger_remainder(int,int,int); void main() { int a,b,c; printf(" Enter the first number:"); scanf("%d",&a); printf("Enter the second number:"); scanf("%d",&b); printf("Enter the third number:"); scanf("%d",&c); a=larger_remainder(a,b,c); if(a==1) printf("true"); else printf("false"); getch(); } int larger_remainder(int x,int y, int z) { if(x%z>y%z) return true; else return false; }

OpenStudy (anonymous):

hey @asnaseer could you explain me anything about this question if you dont mind please

OpenStudy (anonymous):

what don't you understand about the question?

OpenStudy (anonymous):

i dont know what its trying to ask me like its giving me the function name and the parameter HOW do i write that code like i have no clue in that

OpenStudy (anonymous):

oh I see, its asking you to write the function in python. ok. Sorry, I can write it in about 10 languages none of them python sorry.

OpenStudy (anonymous):

oo its alright

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!