Thread: Some questions about conditions

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    96

    Some questions about conditions

    Hi,


    I've got some questions ,wanted to clarify about conditions.

    Q.1 What is the difference bw "Switch" and "If statement"?

    Q.2 In "switch" statement can we use "arithmetic expressions"?


    My other question is that when do we use "nested if" condition?

    eg :
    -----------------------------------------------
    Code:
    if (condition)
    {
    statements;
    if(condition)
    {
    statements;
    }
    statements;
    }
    I wanted to know that in which cases can we use the above condition?

    I hope I am clear

    Thanks

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Sorry, but those questions look a bit too much like homework, and this site has a homework policy.

    How about you attempt to give us answers to those questions? We can then give you some hints if you are missing anything significant.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Quite - some questions about... seems to be a common theme here.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. if and while conditions
    By firehydrant in forum C Programming
    Replies: 12
    Last Post: 03-05-2011, 03:07 AM
  2. Makefile conditions for OS
    By Holymanus in forum C Programming
    Replies: 2
    Last Post: 01-07-2011, 08:54 AM
  3. Multiple conditions for while
    By sfff in forum C Programming
    Replies: 5
    Last Post: 11-08-2009, 11:10 PM
  4. if conditions executing
    By ollie88r in forum C Programming
    Replies: 8
    Last Post: 09-19-2009, 12:57 AM
  5. If statement conditions
    By Brewer in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 05:55 AM