Thread: I have a 2 easy question about some homework?

Threaded View

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

    I have a 2 easy question about some homework?

    Hello,
    i am having a debate with a fello college about this one. Can someone set the record dtraight once and for all with this easy queastion?

    enum color {red, yellow, green, blue}

    QUESTION1:
    What is the value of the expression(enum color) ((int)red +2)?
    a. 0
    b. 1
    c. 2
    d. green
    My answer is C

    enum cday {sun, mon,tue,wen,thu,fri,sat}

    QUESTION2:
    What is the value of the expression(enum day) ((int)thu + 5)% 7)?

    a. 2
    b. sun
    c. mon
    d. tue
    MY answer is mon.

    Later Gator 12%43!&
    -c-c-out
    Last edited by correlcj; 07-18-2002 at 07:24 PM.
    "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. Another Embarassingly Easy Question
    By almo89 in forum C Programming
    Replies: 2
    Last Post: 02-11-2006, 04:59 PM
  2. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  3. Another Homework Question
    By Trekkie in forum C++ Programming
    Replies: 3
    Last Post: 10-20-2005, 06:57 AM
  4. 4 easy question
    By Zeratulsdomain in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2005, 10:43 PM
  5. Easy question about ports
    By Jaguar in forum Tech Board
    Replies: 4
    Last Post: 09-20-2003, 11:41 AM