Thread: c Interview question.

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    1

    c Interview question.

    Dear Friends,

    I have been asked following question in the interview. I tried to find the result but couldnt achieve it.

    Given:
    Concentration = (ep-el) / (ep-em) * (em/el)1/3 *100.
    Where "ep" and "em" are constants. Write a "C" program to determine "el" for
    concentrations 0 to 100 step 10.

    Is it a C precedence trick or quadratic equation problem?

    Any light on this is very useful.

    Have a Good Day.

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Quote Originally Posted by bkankur View Post
    ...Given:
    Concentration = (ep-el) / (ep-em) * (em/el)1/3 *100.

    Your given would get a compiler error.
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    hmm... it does not look like there is any trick to it. It seems more like a test of your algebra skills, followed by understanding of how to express the resulting expression in C with care taken to choose the correct data types so as to obtain the desired result.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by bkankur View Post
    Dear Friends,

    I have been asked following question in the interview. I tried to find the result but couldnt achieve it.

    Given:
    Concentration = (ep-el) / (ep-em) * (em/el)1/3 *100.
    Where "ep" and "em" are constants. Write a "C" program to determine "el" for
    concentrations 0 to 100 step 10.

    Is it a C precedence trick or quadratic equation problem?

    Any light on this is very useful.

    Have a Good Day.
    There is a similar question in K&R for temperature conversion. It's a simple question and doesn't even sound like an interview question. Simply apply loop with increment of 10.
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL buffer channels question
    By TriKri in forum Game Programming
    Replies: 3
    Last Post: 12-09-2009, 05:52 PM
  2. Newbie question, C #
    By mate222 in forum C# Programming
    Replies: 4
    Last Post: 12-01-2009, 06:24 AM
  3. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  4. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  5. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM