CrazyEngineers
  • Need help in a program..

    anksingla

    Member

    Updated: Oct 26, 2024
    Views: 2.3K
    1
    11
    121
    1331
    14641
    can anyone tell the code of this pattern.??
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Kaustubh Katdare

    AdministratorSep 10, 2014

    Dear #-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.
    Are you sure? This action cannot be undone.
    Cancel
  • Anoop Kumar

    MemberSep 10, 2014

    What is next number?? is it 15101051?
    Are you sure? This action cannot be undone.
    Cancel
  • Sanyam Khurana

    MemberSep 10, 2014

    anksingla
    1
    11
    121
    1331
    14641
    can anyone tell the code of this pattern.??
    First show us what you have done so far?
    Are you sure? This action cannot be undone.
    Cancel
  • anksingla

    MemberSep 10, 2014

    Yeah right
    Anoop Kumar
    What is next number?? is it 15101051?
    Are you sure? This action cannot be undone.
    Cancel
  • anksingla

    MemberSep 10, 2014

    Sanyam Khurana
    First show us what you have done so far?
    i am using net on my phone...can't show you the code that i tried..
    Are you sure? This action cannot be undone.
    Cancel
  • Sanyam Khurana

    MemberSep 10, 2014

    anksingla
    i am using net on my phone...can't show you the code that i tried..
    No problem, show us the code when you can and then we would help 😀
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorSep 10, 2014

    anksingla
    i am using net on my phone...can't show you the code that i tried..
    We are in no hurry. Take your time.
    Are you sure? This action cannot be undone.
    Cancel
  • Manish Goyal

    MemberSep 10, 2014

    Very Simple Program,

    Simple Loop, and then a single line if you know multiplication
    Are you sure? This action cannot be undone.
    Cancel
  • anksingla

    MemberSep 10, 2014

    Manish Goyal
    Very Simple Program,

    Simple Loop, and then a single line if you know multiplication
    Yeah this program is a simple multiplication of 11 but I was asked this in different way..
    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..???
    Are you sure? This action cannot be undone.
    Cancel
  • Anoop Kumar

    MemberSep 10, 2014

    Anoop Kumar
    What is next number?? is it 15101051?
    anksingla
    Yeah right
    Oops.... next number will be 161051.
    #-Link-Snipped-# , has provided you the right solution. 😉
    Are you sure? This action cannot be undone.
    Cancel
  • anksingla

    MemberSep 10, 2014

    Anoop Kumar
    Oops.... next number will be 161051.
    #-Link-Snipped-# , has provided you the right solution. 😉
    I forgot to mention that question is not multiplication of 11..
    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"...
    Are you sure? This action cannot be undone.
    Cancel
  • Ramani Aswath

    MemberSep 10, 2014

    One 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?
    Are you sure? This action cannot be undone.
    Cancel
  • anksingla

    MemberSep 10, 2014

    A.V.Ramani
    One 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?
    yes...but I didn't got the right code for this.
    can u tell what's the code for this??
    Are you sure? This action cannot be undone.
    Cancel
  • pritambu

    MemberSep 11, 2014

    Implement this code and run:

    <SNIPPED>
    Are you sure? This action cannot be undone.
    Cancel
  • Kaustubh Katdare

    AdministratorSep 11, 2014

    #-Link-Snipped-# - You suddenly made all of us look idiot. Also, the code you've provided has been copied from <a href="https://forgetcode.com/CSharp/1030-Pascal-triangle-programming" target="_blank" rel="noopener noreferrer">Error - Forget Code</a>
    Are you sure? This action cannot be undone.
    Cancel
  • pritambu

    MemberSep 11, 2014

    Yes because that code is working and giving the correct output.
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal Sharma

    MemberSep 16, 2014

    pritambu
    Yes because that code is working and giving the correct output.
    Wow! 😕
    Are you sure? This action cannot be undone.
    Cancel
  • Sanyam Khurana

    MemberSep 17, 2014

    pritambu
    Yes because that code is working and giving the correct output.
    Standing ovation for you!
    You made all of us look idiots 😀
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register