+ 5
Plz help me to find out the error in this program ( Java ) . Its very urgent. On running it , "Memory Limit exceeeded " is shown
Find the no. x such that if you take the digit in the one's place and place it in front , the new digit formed is 4 times the original number https://code.sololearn.com/cwL0QlEVgI8z/?ref=app https://code.sololearn.com/cwL0QlEVgI8z/?ref=app
12 Antworten
+ 5
https://code.sololearn.com/cwrk1Cw4xxM0/?ref=app
it work fine in my pc
but i say infinite loop is not good..
so you change according to your desire input.
your error in loop and if statement
Pls check and let me if there is any bug
+ 3
Its okk Donna ... :)
+ 2
Donna in front of the no. itself ..
Lyk for ex. in 230769 ,
if 9 is taken out n put in front , then the new no. is 923076 .
And , 923076 = 230769 × 4 .
+ 2
Dario but i need the largest such possible no.
+ 1
Donna 230769 is an example
+ 1
the for loop is a infinite one in fact
for(long=1; i<=0; i++)
never ends.
Try with:
for(long i=0; i<=1000; i++)
or something like this.
+ 1
In CP it works only with i<=70000, you could try in your computer....