flowchart with if else statements

This is a discussion on flowchart with if else statements within the Tech Board forums, part of the Community Boards category; Hey guys, I am trying to create a flow chart and I am sort of stuck on something that should ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    1

    flowchart with if else statements

    Hey guys,

    I am trying to create a flow chart and I am sort of stuck on something that should be simple.

    i am trying to make a flowchart of if else statement which goes like this:

    if x>5,size=big
    else if x<5, size=small
    i am new to programing and i need some help with zis

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Code:
    size = small;
    if(size >5) 
        size = big;
    ?

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    The if should go into a diamond. If I remember correctly the right side is yes (positive result) and the left side is no (negative result) (or you can specify which side is yes/no).

    x > 5 goes in the diamond, Size = big would go into a rectangle on the yes side and the other would have size = small. No need for the else if since else will do the same here. However you have no condition for x == 5.

    I find sequence diagrams far more helpful than flowcharts and they are easier to follow.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Skipping If Statements?
    By CBecker5000 in forum C Programming
    Replies: 1
    Last Post: 11-08-2009, 04:05 PM
  2. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  3. newbie question - if statements without conditions
    By c_h in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 11:42 AM
  4. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 12:36 PM
  5. Need help with "if" statements
    By Harryt123 in forum C Programming
    Replies: 22
    Last Post: 05-14-2006, 09:18 AM

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