I have a binary ?. folks?

This is a discussion on I have a binary ?. folks? within the C Programming forums, part of the General Programming Boards category; Hello again, X=1100110000110011 Y=0000111100001010 what is the binary representation of Y>>4? my answer is... 0000000011110000 is this correct?...

  1. #1
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    I have a binary ?. folks?

    Hello again,


    X=1100110000110011
    Y=0000111100001010

    what is the binary representation of Y>>4?

    my answer is...
    0000000011110000

    is this correct?
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Write a program to find out.
    Code:
    void printbits( unsinged long int x )
    {
        long int y;
        for( y = 0; y < sizeof( unsinged long int ) * 8; y++ )
            printf("%d",(x&(1<<y)));
    }
    But yeah, that would be correct.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    Write a program to find out.

    I did not have to Q, I already knew.
    Look I am a poet and didn't know it.
    Later gator!
    stay real!
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: Write a program to find out.

    Originally posted by correlcj
    I did not have to Q, already knew.
    Look i am a poet and didn't know it.
    Later gator!
    stay real!
    If you already knew, then what was the point of even posting? I have better things to do than to answer questions you already know the answer to.

    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    TransparentMember correlcj's Avatar
    Join Date
    Jun 2002
    Posts
    378

    If you already knew, then what was the point of even posting? I have better things to

    If you had better things to do then why are you here on the computer then?
    "Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
    -Bruce Lee

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. arrays vs lists? And containers in general!
    By clegs in forum C++ Programming
    Replies: 22
    Last Post: 12-03-2007, 01:02 PM
  2. Replies: 0
    Last Post: 11-04-2006, 10:07 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21