A C program

Discussion in 'C Programming' started by Nikhil Joshi, Oct 23, 2012.

  1. Nikhil Joshi

    Nikhil Joshi Guest

    write a program to calculate decimal number from binary number?
    Nikhil Joshi, Oct 23, 2012
    #1
    1. Advertising

  2. Nikhil Joshi

    James Kuyper Guest

    On 10/23/2012 11:54 AM, Nikhil Joshi wrote:
    > write a program to calculate decimal number from binary number?


    Done. Next?
    James Kuyper, Oct 23, 2012
    #2
    1. Advertising

  3. Nikhil Joshi

    Joe Pfeiffer Guest

    Nikhil Joshi <> writes:

    > write a program to calculate decimal number from binary number?


    We can better help if you'll show us what you've already come up with in
    your attempts to write it.
    Joe Pfeiffer, Oct 23, 2012
    #3
  4. Nikhil Joshi

    Rich Webb Guest

    On Tue, 23 Oct 2012 12:05:44 -0400, James Kuyper
    <> wrote:

    >On 10/23/2012 11:54 AM, Nikhil Joshi wrote:
    >> write a program to calculate decimal number from binary number?

    >
    >Done. Next?


    Whee! +1

    --
    Rich Webb Norfolk, VA
    Rich Webb, Oct 23, 2012
    #4
  5. Nikhil Joshi <> writes:
    > write a program to calculate decimal number from binary number?


    We're happy to answer questions about the C language here. Show us
    a program, and we can probably help you figure out what's wrong
    with it. We won't do your homework for you.

    But if you really want us to, please give us your instructor's e-mail
    address, so we can submit our solutions directly. If we do the work,
    we should get the credit, don't you think?

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 23, 2012
    #5
  6. Nikhil Joshi

    BruceS Guest

    On Tue, 23 Oct 2012 12:05:44 -0400, James Kuyper wrote:

    > On 10/23/2012 11:54 AM, Nikhil Joshi wrote:
    >> write a program to calculate decimal number from binary number?

    >
    > Done. Next?


    Your posts are among the first I look for. Often this provides
    information, but this time it gave me a good laugh. Thanks.
    BruceS, Oct 29, 2012
    #6
  7. Nikhil Joshi

    tom st denis Guest

    On Oct 23, 11:54 am, Nikhil Joshi
    <> wrote:
    > write a program to calculate decimal number from binary number?


    I'mma gonna go beyond what the other people wrote and just say this.

    Drop out of whatever program you are in now. If this sort of program
    stumps you you have no business studying computer science nor software
    development. This is the equivalent of a math major asking us to help
    them solve the matrix

    [ 2 1 ]
    [ 1 1 ]

    It's the sort of thing that if you have to ask you really shouldn't be
    in the business.

    So please, do yourself and anyone you'd potentially end up working
    with a favour and either STUDY FUCKING HARDER or DROP THE **** OUT.

    Sincerely,
    Tom
    tom st denis, Oct 30, 2012
    #7
  8. tom st denis <> writes:

    > On Oct 23, 11:54 am, Nikhil Joshi
    > <> wrote:
    >> write a program to calculate decimal number from binary number?

    >
    > I'mma gonna go beyond what the other people wrote and just say this.
    >
    > Drop out of whatever program you are in now. If this sort of program
    > stumps you you have no business studying computer science nor software
    > development. This is the equivalent of a math major asking us to help
    > them solve the matrix


    I may have missed some of this thread, but how do you know the OP is a
    CS major? I was quite good at academic CS, but there was a time when I
    did not know how to do this.

    <snip>
    --
    Ben.
    Ben Bacarisse, Oct 30, 2012
    #8
  9. Nikhil Joshi

    tom st denis Guest

    On Oct 30, 11:42 am, Ben Bacarisse <> wrote:
    > tom st denis <> writes:
    >
    > > On Oct 23, 11:54 am, Nikhil Joshi
    > > <> wrote:
    > >> write a program to calculate decimal number from binary number?

    >
    > > I'mma gonna go beyond what the other people wrote and just say this.

    >
    > > Drop out of whatever program you are in now.  If this sort of program
    > > stumps you you have no business studying computer science nor software
    > > development.  This is the equivalent of a math major asking us to help
    > > them solve the matrix

    >
    > I may have missed some of this thread, but how do you know the OP is a
    > CS major?  I was quite good at academic CS, but there was a time when I
    > did not know how to do this.


    This is clearly a homework question of some sort given the lack of
    details other than a fairly obvious problem statement that came from a
    lab somewhere.

    Tom
    tom st denis, Oct 30, 2012
    #9
  10. Nikhil Joshi

    BartC Guest

    "tom st denis" <> wrote in message
    news:...

    > This is the equivalent of a math major asking us to help
    > them solve the matrix
    >
    > [ 2 1 ]
    > [ 1 1 ]


    What's the answer?

    --
    Bartc
    BartC, Oct 30, 2012
    #10
  11. Nikhil Joshi

    tom st denis Guest

    On Oct 30, 12:13 pm, "BartC" <> wrote:
    > "tom st denis" <> wrote in messagenews:...
    >
    > > This is the equivalent of a math major asking us to help
    > > them solve the matrix

    >
    > > [ 2 1 ]
    > > [ 1 1 ]

    >
    > What's the answer?


    R1-R2 and then R2-R1.

    So suppose you had the linear system

    [2 1][3]
    [1 1][2]

    Then you'd have

    [1 0][1]
    [1 1][2]

    And

    [1 0][1]
    [0 1][1]

    So x = 1 and y = 1 in this linear system.

    MAGIC!
    tom st denis, Oct 30, 2012
    #11
  12. Nikhil Joshi

    James Kuyper Guest

    On 10/30/2012 12:38 PM, tom st denis wrote:
    > On Oct 30, 12:13�pm, "BartC" <> wrote:
    >> "tom st denis" <> wrote in messagenews:...
    >>
    >>> This is the equivalent of a math major asking us to help
    >>> them solve the matrix

    >>
    >>> [ 2 1 ]
    >>> [ 1 1 ]

    >>
    >> What's the answer?

    >
    > R1-R2 and then R2-R1.


    You haven't defined what R1 and R2 refer to, nor what those expressions
    mean.

    > So suppose you had the linear system
    >
    > [2 1][3]
    > [1 1][2]
    >
    > Then you'd have
    >
    > [1 0][1]
    > [1 1][2]
    >
    > And
    >
    > [1 0][1]
    > [0 1][1]
    >
    > So x = 1 and y = 1 in this linear system.


    Nor have you defined what x and y refer to.

    Your original statement of the problem lacked sufficient detail to make
    "solve" an applicable verb. There was sufficient information to use
    "invert", instead. If you had added some variables, and asked to solve
    for the values of those variables, for example:

    "Solve
    | 2 1 | |x| = |a|
    | 1 1 | |y| |b|

    For x and y in terms of a and b"

    that would also have been a meaningful question, with the answer x=a-b,
    y=2b-a.
    --
    James Kuyper
    James Kuyper, Oct 30, 2012
    #12
  13. Nikhil Joshi

    Eric Sosman Guest

    On 10/30/2012 12:12 PM, BartC wrote:
    > "tom st denis" <> wrote in message
    > news:...
    >
    >> This is the equivalent of a math major asking us to help
    >> them solve the matrix
    >>
    >> [ 2 1 ]
    >> [ 1 1 ]

    >
    > What's the answer?


    42.

    --
    Eric Sosman
    d
    Eric Sosman, Oct 30, 2012
    #13
  14. Nikhil Joshi

    Joe Pfeiffer Guest

    tom st denis <> writes:

    > On Oct 23, 11:54 am, Nikhil Joshi
    > <> wrote:
    >> write a program to calculate decimal number from binary number?

    >
    > I'mma gonna go beyond what the other people wrote and just say this.
    >
    > Drop out of whatever program you are in now. If this sort of program
    > stumps you you have no business studying computer science nor software
    > development.


    This strikes me as too harsh. This is the sort of thing that will
    challenge a freshman (and maybe even a sophomore) the first time they
    see it; he does need to be told to do his own homework (and has been);
    he only needs to change majors if he doesn't get better.
    Joe Pfeiffer, Oct 30, 2012
    #14
  15. Nikhil Joshi

    tom st denis Guest

    On Oct 30, 12:57 pm, James Kuyper <> wrote:
    > On 10/30/2012 12:38 PM, tom st denis wrote:
    >
    > > On Oct 30, 12:13 pm, "BartC" <> wrote:
    > >> "tom st denis" <> wrote in messagenews:...

    >
    > >>> This is the equivalent of a math major asking us to help
    > >>> them solve the matrix

    >
    > >>> [ 2 1 ]
    > >>> [ 1 1 ]

    >
    > >> What's the answer?

    >
    > > R1-R2 and then R2-R1.

    >
    > You haven't defined what R1 and R2 refer to, nor what those expressions
    > mean.


    Row 1 and Row 2 ... are you really this dense?

    > > So x = 1 and y = 1 in this linear system.

    >
    > Nor have you defined what x and y refer to.


    [2x 1y][3]
    [1x 1y][2]

    Whatever, you're missing the point. Usually if I say "produce a
    solution for this matrix" it means the program [or steps] required to
    reduce it to REF. Then when you plug in variables in your column
    matrix you need only run the program and voila your solution.

    For instance, this is used in Karatsuba and Toom-Cook multiplication.
    You end up with a constant matrix but variable column matrix to attach
    to it. So the way you solve the system NEVER changes and you can
    optimize it thusly.

    Tom
    tom st denis, Oct 30, 2012
    #15
  16. tom st denis <> writes:

    > On Oct 30, 11:42 am, Ben Bacarisse <> wrote:
    >> tom st denis <> writes:
    >>
    >> > On Oct 23, 11:54 am, Nikhil Joshi
    >> > <> wrote:
    >> >> write a program to calculate decimal number from binary number?

    >>
    >> > I'mma gonna go beyond what the other people wrote and just say this.

    >>
    >> > Drop out of whatever program you are in now.  If this sort of program
    >> > stumps you you have no business studying computer science nor software
    >> > development.  This is the equivalent of a math major asking us to help
    >> > them solve the matrix

    >>
    >> I may have missed some of this thread, but how do you know the OP is a
    >> CS major?  I was quite good at academic CS, but there was a time when I
    >> did not know how to do this.

    >
    > This is clearly a homework question of some sort given the lack of
    > details other than a fairly obvious problem statement that came from a
    > lab somewhere.


    Yes it is. I don't see how that relates to my message.

    --
    Ben.
    Ben Bacarisse, Oct 30, 2012
    #16
  17. Nikhil Joshi

    tom st denis Guest

    On Oct 30, 1:15 pm, Joe Pfeiffer <> wrote:
    > tom st denis <> writes:
    >
    > > On Oct 23, 11:54 am, Nikhil Joshi
    > > <> wrote:
    > >> write a program to calculate decimal number from binary number?

    >
    > > I'mma gonna go beyond what the other people wrote and just say this.

    >
    > > Drop out of whatever program you are in now.  If this sort of program
    > > stumps you you have no business studying computer science nor software
    > > development.

    >
    > This strikes me as too harsh.  This is the sort of thing that will
    > challenge a freshman (and maybe even a sophomore) the first time they
    > see it; he does need to be told to do his own homework (and has been);
    > he only needs to change majors if he doesn't get better.


    I think it boils down to a complete and utter lack of intuition and
    drive for knowledge. Likely the person is looking for the easiest
    cheap ride through to a diploma so they can then waste peoples time as
    a completely worthless software developer.

    I could have solved this problem when I was 8 years old. So in
    effect, this guy has less intuition about software and computer
    science than a C average 8 year old from a small town in Ontario
    Canada. That's not saying much for their worth as a student let alone
    an eventual professional.
    tom st denis, Oct 30, 2012
    #17
  18. Nikhil Joshi

    tom st denis Guest

    On Oct 30, 1:28 pm, Ben Bacarisse <> wrote:
    > tom st denis <> writes:
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > > On Oct 30, 11:42 am, Ben Bacarisse <> wrote:
    > >> tom st denis <> writes:

    >
    > >> > On Oct 23, 11:54 am, Nikhil Joshi
    > >> > <> wrote:
    > >> >> write a program to calculate decimal number from binary number?

    >
    > >> > I'mma gonna go beyond what the other people wrote and just say this.

    >
    > >> > Drop out of whatever program you are in now.  If this sort of program
    > >> > stumps you you have no business studying computer science nor software
    > >> > development.  This is the equivalent of a math major asking us to help
    > >> > them solve the matrix

    >
    > >> I may have missed some of this thread, but how do you know the OP is a
    > >> CS major?  I was quite good at academic CS, but there was a time when I
    > >> did not know how to do this.

    >
    > > This is clearly a homework question of some sort given the lack of
    > > details other than a fairly obvious problem statement that came from a
    > > lab somewhere.

    >
    > Yes it is.  I don't see how that relates to my message.


    Even if the problem were challenging [which I maintain it is not] the
    very lack of effort on their part should be a sufficient strike
    against their character.

    Tom
    tom st denis, Oct 30, 2012
    #18
  19. tom st denis <> writes:

    > On Oct 30, 1:15 pm, Joe Pfeiffer <> wrote:
    >> tom st denis <> writes:
    >>
    >> > On Oct 23, 11:54 am, Nikhil Joshi
    >> > <> wrote:
    >> >> write a program to calculate decimal number from binary number?

    >>
    >> > I'mma gonna go beyond what the other people wrote and just say this.

    >>
    >> > Drop out of whatever program you are in now.  If this sort of program
    >> > stumps you you have no business studying computer science nor software
    >> > development.

    >>
    >> This strikes me as too harsh.  This is the sort of thing that will
    >> challenge a freshman (and maybe even a sophomore) the first time they
    >> see it; he does need to be told to do his own homework (and has been);
    >> he only needs to change majors if he doesn't get better.

    >
    > I think it boils down to a complete and utter lack of intuition and
    > drive for knowledge. Likely the person is looking for the easiest
    > cheap ride through to a diploma so they can then waste peoples time as
    > a completely worthless software developer.
    >
    > I could have solved this problem when I was 8 years old. So in
    > effect, this guy has less intuition about software and computer
    > science than a C average 8 year old from a small town in Ontario
    > Canada. That's not saying much for their worth as a student let alone
    > an eventual professional.


    Using yourself as an example is wrong unless you consider yourself just
    about the least talented programmer who ever benefited from studying
    programing. I suspect you had an average or above average talent for
    programming, which means that there are thousands and thousands of less
    talented programmers who, every year, study programming a benefited form
    it.

    --
    Ben.
    Ben Bacarisse, Oct 30, 2012
    #19
  20. Nikhil Joshi

    tom st denis Guest

    On Oct 30, 1:42 pm, Ben Bacarisse <> wrote:
    > Using yourself as an example is wrong unless you consider yourself just
    > about the least talented programmer who ever benefited from studying
    > programing.  I suspect you had an average or above average talent for
    > programming, which means that there are thousands and thousands of less
    > talented programmers who, every year, study programming a benefited form
    > it.


    This guy isn't creating a complicated data compression scheme or
    writing a schedule for a pre-emptive OS. It's converting binary to
    decimal. It's about as basic as it gets. If this sort of problem
    challenges him/her so much that they can't even post their [failed]
    attempt at solving it ... they really need to think hard about the
    industry they're in.

    Worse, if the guy didn't even bother trying and is just looking for a
    free ride they should do everyone a favour and step down. Leave room
    in the programme for people who actually want to try.
    tom st denis, Oct 30, 2012
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pipi
    Replies:
    1
    Views:
    613
    Joseph Millar
    Jul 21, 2003
  2. Rey
    Replies:
    4
    Views:
    10,915
    Roedy Green
    Dec 12, 2003
  3. ola
    Replies:
    3
    Views:
    703
    Marco Schmidt
    Feb 16, 2004
  4. Parvsandhu
    Replies:
    2
    Views:
    406
    Thomas Weidenfeller
    Jul 11, 2005
  5. Replies:
    1
    Views:
    507
    Andrew Thompson
    Oct 31, 2005
Loading...

Share This Page