Thread: more variable help

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    77

    Talking more variable help

    ok now that i finally got that little problem with the variable out of the way im now into the if function in my tutorial. i understand it and all i was just wondering though how can i make it determine if the entered number is inbetween a set a of numbers.

    ex.

    if(a<13)
    {
    printf("text here");
    }
    else if(a inbetween 2 numbers)
    {
    printf("text here");
    }

    thanks

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Code:
    if ( a < VAL )
      printf ( "Text here" );
    else if ( a >= LOWVAL && HIGHVAL >= a )
      printf ( "Text here" );
    This checks if a is less than val, if that fails then it checks if a is between LOWVAL and HIGHVAL or equal to either.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    77
    Thanks
    Hooked On Phonics Didn't Work For Me!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How accurate is the following...
    By emeyer in forum C Programming
    Replies: 22
    Last Post: 12-07-2005, 12:07 PM
  2. Use of variable
    By alice in forum C Programming
    Replies: 8
    Last Post: 06-05-2004, 07:32 AM
  3. Replies: 2
    Last Post: 04-12-2004, 01:37 AM
  4. write Variable and open Variable and get Information
    By cyberbjorn in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2004, 01:30 AM
  5. Variable question I can't find answer to
    By joelmon in forum C++ Programming
    Replies: 3
    Last Post: 02-12-2002, 04:11 AM