Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 11 Online
OpenStudy (anonymous):

Write a program that tests integers to see if they are special. A special integer is one in which all of the digits have the same value. The program should allow testing as many values as the user wishes. You should use the % operator (called “mod”) which, if both operands are non-negative integers, gives the remainder of an integer division. Thus, for example, 1357%10 is 7 (the rightmost digit of the number). Also note that the / operator, if both operands are non-negative integers, will give all digits except the rightmost digit: 1357/10 is 135. You can use these two operators and a loo

OpenStudy (anonymous):

can someone help me do this its for an intro class, its in C ++

OpenStudy (anonymous):

http://pastebin.com/bmA0qBfW

OpenStudy (anonymous):

i cant use a list

OpenStudy (anonymous):

Think about it this way: Input: An integer (base 10) called num Output: A boolean value. Local variables: integer bin, integer i. i := 0 bin = num%10 Loop: While num != 0 do: i = num%10 if i != bin then return false num = num/10 End Loop Return true In C code, one way to code it would be: http://codepad.org/a4Jwx6h7

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!