Need help in a program..
1
11
121
1331
14641
can anyone tell the code of this pattern.??
11
121
1331
14641
can anyone tell the code of this pattern.??
Replies
-
Kaustubh KatdareDear #-Link-Snipped-# - We'd really love to see your attempt at the code. Don't worry even if it's wrong. Please share it so that the expert coders here can help you fix it. It'll be a great learning for you as well.
-
Anoop KumarWhat is next number?? is it 15101051?
-
Sanyam Khurana
First show us what you have done so far?anksingla1
11
121
1331
14641
can anyone tell the code of this pattern.?? -
anksinglaYeah right
Anoop KumarWhat is next number?? is it 15101051? -
anksingla
i am using net on my phone...can't show you the code that i tried..Sanyam KhuranaFirst show us what you have done so far? -
Sanyam Khurana
No problem, show us the code when you can and then we would help 😀anksinglai am using net on my phone...can't show you the code that i tried.. -
Kaustubh Katdare
We are in no hurry. Take your time.anksinglai am using net on my phone...can't show you the code that i tried.. -
Manish GoyalVery Simple Program,
Simple Loop, and then a single line if you know multiplication -
anksingla
Yeah this program is a simple multiplication of 11 but I was asked this in different way..Manish GoyalVery Simple Program,
Simple Loop, and then a single line if you know multiplication
numbers b/w two 1's is the sum of two numbers of above line..like in 121 2 is sum of 11 which is above of 121...
can we made the logic of this pattern in this way..??? -
Anoop KumarAnoop KumarWhat is next number?? is it 15101051?
Oops.... next number will be 161051.anksinglaYeah right
#-Link-Snipped-# , has provided you the right solution. 😉 -
anksingla
I forgot to mention that question is not multiplication of 11..Anoop KumarOops.... next number will be 161051.
#-Link-Snipped-# , has provided you the right solution. 😉
the question I asked is to find the
"the no's b/w the two 1's is the sum of two no's of above line like in 121 2 is sum of 11 & similarly in 1331 first 3 is sum
of 12 & second is 21 of 121"... -
Ramani AswathOne way of looking at multiplying by 11 is 'Shift and Add'. In effect adding ten times the number to the number.
Put zero in front and at the end of a number that is 0110 for 11. Start adding pairs from the right: 1+0 = 1 which becomes the rightmost digit of the answer. then 1+1 = 2, the second digit and finally 0+1 = 1 the third digit giving the result 121.
This is the method called 'add the neighbour' by Trachtenberg in his teatise on speed mathematics.
Is this what you are getting at? -
anksingla
yes...but I didn't got the right code for this.A.V.RamaniOne way of looking at multiplying by 11 is 'Shift and Add'. In effect adding ten times the number to the number.
Put zero in front and at the end of a number that is 0110 for 11. Start adding pairs from the right: 1+0 = 1 which becomes the rightmost digit of the answer. then 1+1 = 2, the second digit and finally 0+1 = 1 the third digit giving the result 121.
This is the method called 'add the neighbour' by Trachtenberg in his teatise on speed mathematics.
Is this what you are getting at?
can u tell what's the code for this?? -
pritambuImplement this code and run:
-
Kaustubh Katdare#-Link-Snipped-# - You suddenly made all of us look idiot. Also, the code you've provided has been copied from Error - Forget Code
-
pritambuYes because that code is working and giving the correct output.
-
Vishal Sharma
Wow! 😕pritambuYes because that code is working and giving the correct output. -
Sanyam Khurana
Standing ovation for you!pritambuYes because that code is working and giving the correct output.
You made all of us look idiots 😀
You are reading an archived discussion.
Related Posts
I always had a query. I have really good software development background (although I am a Mechanical Engineer by education & profession). How do random number generators work?
A thought...
what is the reason for the input impedence in the open circuit transmission line to behave inductive or capacitive...?i came to know that depending upon value(+ve or -ve) of (Bl)...
While Apple had everybody’s attention during its iPhone 6 and Apple Watch launch event, Qualcomm Technologies announced a slew of new processors that will bring 4G LTE connectivity equipped smartphones...
Let me introduce myself, im Cesar Balderas from Mexico, im a last year IT engineer student, I joined CE because I was looking for ideas to apply in my 2...
Many of us have experienced the irritating flash of light from an oncoming vehicle while steering along a highway during the late hours. At that time, we just toddle along...