Thread: two variables?

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    6

    two variables?

    I need to test the following code fragment for the variable num. For me to completely test all branches, would I use 2 values of num?

    How many values of the variable num must by used to completely test all branches of the following code fragment?
    if (num > 0 )
    if (value < 25 )
    {
    value = 10 * num;
    if ( num < 12 )
    value = value / 10;
    } / * if sum * /
    else value = 20 * num;
    else value = 30 * num;



    Thanks!

  2. #2
    Unregistered
    Guest

    Post

    3
    1) <=0
    2) >0 & <=12
    3) > 12

    vishnu
    ([email protected])

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. basic question about global variables
    By radeberger in forum C++ Programming
    Replies: 0
    Last Post: 04-06-2009, 12:54 AM
  2. Replies: 15
    Last Post: 09-30-2008, 02:12 AM
  3. esbo's data sharing example
    By esbo in forum C Programming
    Replies: 49
    Last Post: 01-08-2008, 11:07 PM
  4. Replies: 6
    Last Post: 01-02-2004, 01:01 PM
  5. functions to return 2 variables?
    By tim in forum C Programming
    Replies: 5
    Last Post: 02-18-2002, 02:39 PM