BrainDump
  Home arrow BrainDump arrow C: Logical Operators
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

C: Logical Operators
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-03-10

    Table of Contents:
  • C: Logical Operators
  • Logical AND
  • You Are Cool....Not(!)
  • Logical OR(||)

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    C: Logical Operators
    (Page 1 of 4 )

    In our last two articles we talked about statements and working with text in C. In this article we are going to learn to use a logical operator alongside our statements, and work with the various loops (hopefully). We'll start with a short review of what we already know about logical operators, and then we'll dive right in.

    Working with Logical Operators

    We touched on logical operators briefly in a prior article. As a reminder, here is a table showcasing logical operators and their purposes:

     

    Operator

    What it Does

    Example

    &&

    Logical AND tests 2 conditions to see if they are true

    5 > 4 && 5 < 6

    ||

    Logical OR checks to see if any one of two expressions is true

    b <c || b <d

    !

    Logical NOT evaluates to true if the expression is false and false if the expression is true

    ! 2 > 3 (result would be true, as 2 is not greater than 3)

    As you can see, there are three logical operators: the AND (&&), the OR (||) and the NOT(!).

    More BrainDump Articles
    More By James Payne


       · Thanks for dropping by to read my article on C Logical Operators. In this issue we...
     

    BRAINDUMP ARTICLES

    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo
    - Windows XP Tips for Task Manager
    - Generating Clients and Services with Indigo
    - Vista SP1, A Review
    - Services and the WCF
    - VBScript: Final Date Functions
    - Creating Services with the WCF
    - The Resource View of the MFC
    - VBScript: More Fun with the Date Functions
    - Vista Price Cuts Dissected

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway