Here are some simple ?'s

This is a discussion on Here are some simple ?'s within the C Programming forums, part of the General Programming Boards category; Hello, can anyone answer these question for me? Q1: Choose the statement which defines enu type fuzzy consisting of values ...

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

    Here are some simple ?'s

    Hello,
    can anyone answer these question for me?
    Q1: Choose the statement which defines enu type fuzzy consisting of values false, maybe and true. Defined so that maybe is greater than false but less than true.
    a. enum fuzzy{false, maybe,true};
    b. enum fuzzy{true,false,maybe};
    c. enum fuzzy{false, maybe,true}
    d. enum fuzzy{true,maybe,false};

    I chose b

    Next,
    which statement allocates space for a variable of the defined enum type?
    a. enum color{red,yellow,blue}paint;
    b. enum color{red,yellow,blue};
    c. enum color{red,yellow,blue}paint;
    d. a & c

    I chose B

    Can anyone tell if I am right and if i am wrong what is the anwers and why?
    "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
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Q1 - C
    Q2 - D

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: Here are some simple ?'s

    >... Defined so that maybe is greater than false but less than true.
    >I chose b
    Then you'd be wrong. Read the question again, the only key bit is what I have quoted above.
    Why are answers A and C the same?
    [EDIT] Oh, they're not the same sneaky [/EDIT]

    >which statement allocates space for a variable of the defined enum type?
    >I chose B
    Again, you'd be wrong, I'm afraid.
    Why are answers A and C the same?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

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

    Cool Why are answers A and C the same?

    To throw off the Mighty Hammer.
    But the question was inevitablely simple, was it not?
    Thanks again.
    "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

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: Why are answers A and C the same?

    >To throw off the Mighty Hammer.
    Toying with me, eh?!!

    >But the question was inevitablely simple, was it not?
    Yes!

    >Thanks again.
    No prob.

    And the answer to Q1 is A, not C.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Why are answers A and C the same?
    [EDIT] Oh, they're not the same sneaky [/EDIT]
    I need some rest.

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >I chose b
    The correct answer is A, C and A are identical except C contains a syntax error and is made invalid because of this.

    >which statement allocates space for a variable of the defined enum type?
    I'm very much against trick questions as they do not judge your knowledge, they simply imply incorrect answers. This question could be interpreted to be all of the answers.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 06:26 PM
  2. Simple message encryption
    By Vicious in forum C++ Programming
    Replies: 10
    Last Post: 11-07-2004, 11:48 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  4. Simple simple program
    By Ryback in forum C++ Programming
    Replies: 10
    Last Post: 09-09-2004, 06:48 AM
  5. Need help with simple DAQ program
    By canada-paul in forum C++ Programming
    Replies: 12
    Last Post: 03-15-2002, 08:52 AM

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