Re: modulus operator % Programming Software Development by Shankye … is 3 .. First 3*3*3 gives 27 thn modulus operator gives remainder of 27%4 Hence ans is 3..…operator precedence in C [COLOR="Red"]* / % Multiplication/division/modulus left-to-right[/COLOR] so first multiplication is done and… thn division if any and thn modulus operator comes.. Hence the result 3.. Re: modulus operator % Programming Software Development by ankitcuul … [B][U]Shankye[/U][/B] As u already know that modulus operator gives the remainder of the division of two operands… proove this thing u might have notinced this that the modulus operator gives same result for the operation (x%y) if… modulus operator % Programming Software Development by degamer106 Hmm I was lookin through a recursion program in this book i have here and the only thing I'm having trouble with is the modulus operator. I know that it returns the remainder of 2 numbers. But, suppose I have this: x % y If x > y then the result is x. Am I tripping out o_O? Re: modulus operator % Programming Software Development by Auraomega I think you've misunderstood how modulus works, or maybe I've misunderstood you :P Basically in … Re: determining a interger if divisible without using modulus Programming Software Development by griswolf Modulus operator is the right thing to use. Why not? However, … Re: Modulus bug Programming Software Development by zeroliken It's not really a bug, the modulus is doing whats its suppose to do are you trying to make the program display 0 when 30 or a similar case is entered? Re: modulus operator Programming Software Development by gerard4143 Well 3 divided by 5 has 3 left over. The modulus operator computes the remainder of integer division. Re: modulus operator Programming Software Development by JasonHippy The modulus operator returns the remainder after the division operation. So 3%5 returns 3 because 3 divides by 5 zero times and the remainder is 3. Need help in assembly code with modulus Programming Software Development by slicer …++ it is hard for me to understand the concept of modulus as all I use is the symbol % to compute. The… exponent of X to the Y power and then the modulus of this answer with Z. Where X, Y, and … is greater than 1 jump to loop mod al,dl ;???MODULUS??? I know this isn't ;right, it is the part… Using modulus Programming Computer Science by noodlecode For newer programmers, myself included, modulus is probably the most obscure operator. ie easy to understand,… use for. But when you see an algorithm that uses modulus, it immediately makes sense. How about a few samples where… modulus works well. For example, is a number odd or even … Re: Need help in assembly code with modulus Programming Software Development by thines01 … remainder in DX int 20h ;C:\science\asm>debug MODULUS.COM ;-r ;AX=0000 BX=0000 CX=000A DX=0000… DX int 20h ; BYTE Example ;C:\science\asm>debug MODULUS.COM ;-r ;AX=0000 BX=0000 CX=000A DX=0000… Re: Need help in assembly code with modulus Programming Software Development by thines01 ...all of that means you get the modulus by calling DIV. The modulus will be in AH (for BYTE division) or in DX (for WORD division). Where does Modulus fit in with PEMDAS? Programming Software Development by Alex Edwards … but I would rather not until I can determine where modulus fits in with PEMDAS. To those who don't know…. Now my problem is that I don't know where Modulus fits in with PEMDAS. Does it have higher or lower… Re: Where does Modulus fit in with PEMDAS? Programming Software Development by dougy83 ….cppreference.com/wiki/operator_precedence[/url] You're right, division/multiplication/modulus all have equal precedence. [QUOTE=VernonDozier;731746] ... It's one…;2 operators having equal precedence (i.e. when you add modulus to the mix). Re: Where does Modulus fit in with PEMDAS? Programming Software Development by Alex Edwards … or subtract first. Are you using unsigned types? And if modulus has equal precedence then I suppose my program is technically… when you say I need a third option (i.e. Modulus before Division but after Multiplication), when M and D are… Re: Where does Modulus fit in with PEMDAS? Programming Software Development by VernonDozier … or subtract first. Are you using unsigned types? And if modulus has equal precedence then I suppose my program is technically… when you say I need a third option (i.e. Modulus before Division but after Multiplication), when M and D are… Re: Using modulus Programming Computer Science by tux4life You can use the modulus operator to convert numbers to another base (e.g: from decimal to octal/hexadecimal/binary/etc.) ... Re: Using modulus Programming Computer Science by tux4life [QUOTE=tux4life;841781]You can use the modulus operator to convert numbers to another base (e.g: from decimal to octal/hexadecimal/binary/etc.) ...[/QUOTE] Look at [URL="http://www.daniweb.com/code/snippet104.html"]this[/URL] code snippet on Daniweb ... Re: Using modulus Programming Computer Science by thoughtcoder For algorithms that directly require modular arithmetic, such as some encryption algorithms. For writing log messages every Nth time through a loop. The "do something every Nth time through a loop" problem is probably where you'll see the modulus operator used most often. Re: Using modulus Programming Computer Science by MosaicFuneral [QUOTE=thoughtcoder;841923]The "do something every Nth time through a loop" problem is probably where you'll see the modulus operator used most often.[/QUOTE] I generally just use the logical AND operator for that. integer division / modulus controlled looping Programming Software Development by Griff0527 …), but cannot figure out how to use integer division and modulus as a loop control. Can someone help explain it to… to C++ documentation describing how to use int division and modulus as a loop control. Thank you, Griff0527 [CODE] #include <… How to find large modulus on Casio fx-991 MS Programming Computer Science by logicslab Hi pals, I am looking to find a modulus calculation using my casio fx-991 ms calculator i know …how to find modulus using small numbers eg: 7 mod 3 = 1. This because… Re: Where does Modulus fit in with PEMDAS? Programming Software Development by Alex Edwards Bah nevermind, I'll keep it as it is. Thanks for confirming the precedence of modulus! Re: integer division / modulus controlled looping Programming Software Development by Griff0527 … am trying to understand how to use integer division and modulus to do the same thing as using a character to… hellp with modulus Programming Software Development by mina1984 hey, um i was wondering if anyone could help me with a program where if the user inputs a number no more than 5 digits and the program tells you how many times the number 2 appears in that number. i know that the modulus and division have to be used but i dont know how to set that part up can someone help?? thanxxxx queue and modulus question Programming Software Development by degamer106 I'm kind of confused about how the modulus operator works. Suppose i have x % y with x > … Using Modulus Programming Software Development by wanda When using the modulus, if a<b, then a%b = a. But why, if a is negative, does -a%b = -a? According to the division algorithm, the remainder r must be >= 0 and <|b|. Use modulus operator to convert time Programming Software Development by JHus00 I need to convert hours into weeks, days, and hours. My professor was hinting that there might be a way to do this using the modulus operator but I can't seem to think of a way that its possible. Can anyone help? thanks! determining a interger if divisible without using modulus Programming Software Development by acejhon helo guys good day... i have a problem in python programming... im new to this langauage.. im having a bit problem on creating a program in python that would determine if the integer is divisible by 3 or not without using a modulus? im glad if you can help me .... im willing to know more about this language... thanks...... =) Stuck using modulus. Programming Software Development by Urv73 … of seconds into hours, minutes and seconds. I wanna use modulus to get the result I'm looking for. I KNOW…