Thread: Conditional Operator

  1. #1
    Registered User
    Join Date
    Dec 2011
    Location
    Rawalpindi, Pakistan, Pakistan
    Posts
    12

    Conditional Operator

    If we want to differentiate 3 numbers provided by user to show which is maximum and which is minimum.What will be our c program statement???

  2. #2
    Registered User joybanerjee39's Avatar
    Join Date
    Oct 2011
    Location
    kolkata
    Posts
    106
    Quote Originally Posted by Waqas Asad View Post
    If we want to differentiate 3 numbers provided by user to show which is maximum and which is minimum.What will be our c program statement???
    what do you think it will be?

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    23
    Read about the conditional operator here:
    Dystopian Code: The Conditional Operator

  4. #4
    Registered User
    Join Date
    Nov 2011
    Location
    Buea, Cameroon
    Posts
    197

    Cool i think this may solve this problem

    guys check out the logic in this code.


    Code:
    return  if (is_true) ? a: b;
    
    return c:

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Nyah Check
    guys check out the logic in this code.
    Looks like a syntax error or two to me.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. conditional operator
    By nasser in forum C Programming
    Replies: 2
    Last Post: 10-23-2011, 07:18 PM
  2. Conditional Operator
    By markcocoa10 in forum C Programming
    Replies: 7
    Last Post: 10-15-2010, 06:22 PM
  3. conditional operator, 3 conditions
    By EffecTed in forum C Programming
    Replies: 4
    Last Post: 04-02-2010, 11:57 AM
  4. Conditional Operator
    By arjunajay in forum C Programming
    Replies: 8
    Last Post: 07-10-2008, 08:17 AM
  5. Conditional operator ? :)
    By ER in forum C++ Programming
    Replies: 4
    Last Post: 11-29-2001, 03:34 AM

Tags for this Thread