Some questions about conditions

This is a discussion on Some questions about conditions within the C++ Programming forums, part of the General Programming Boards category; Hi, I've got some questions ,wanted to clarify about conditions. Q.1 What is the difference bw "Switch" and "If statement" ...

  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,266
    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%.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,505
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 02:07 AM
  2. Makefile conditions for OS
    By Holymanus in forum C Programming
    Replies: 2
    Last Post: 01-07-2011, 07:54 AM
  3. Multiple conditions for while
    By sfff in forum C Programming
    Replies: 5
    Last Post: 11-08-2009, 10: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, 04:55 AM

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