advertisement

advertisement

Information about Presentation on Logical Operators

Published on March 7, 2014

Author: sanjeevbudha

Source: slideshare.net

advertisement

Logical Operators: • Programming is all about logics. Logical operators form important block in software development. • Three kind of Logical Operators: AND OR NOT

Logical Operators AND Logical Operator • Holds true only when all the Boolean variables provide true value. • Example • If(X >Y && X> Z) -> Then X is greatest. OR Logical Operator • Holds true if any one Boolean variable is true. • Example • If(day == 0 || day == 1) where 0= Saturday And 1= Sunday ->Then DWIT is enjoying weekend

NOT Logical Operator • It is unary operator as it has only one operand • If something is true, ! makes false; if it is false,! Makes it true. • For example (x==7) is true if x is equal to 7,but !(x==7) is true if x is not equal to 7. • While(day != 0 && day !=1) -> day is not weekend

SUMMARY OF PRECEDENCE Operator type Operators Unary !, ++, - -, -, + Arithmetic +, - , * , / , % Relational <, >, >=, <=, ==, != Logical &&, ||, ! Conditional ?: Assignment = , - = , +=, /= , %= Precedence Highest Lowest

OTHER CONTROL STATEMENTS BREAK STATEMENT CONTINUE STATEMENT • Break The Loop • Example • Continue The Loop From Beginning • Example include<stdio.h> Int main(){ Int I = 0; Do{ i++; printf(“before continue”); continue; printf(“After continue”); }while(i<3); } include<stdio.h> Int main(){ Int I = 0; Do{ i++; printf(“before continue”); break; printf(“After continue”); }while(i<3); }

Goto statement: - It is not practiced nowadays. It takes us to procedural language.

1 Logical Operators Java provides two binary logical operators (&& and ||) that are used to combine boolean expressions. Java also provides one unary (!)

Read more

Bits and Bytes. BITWISE OPERATORS Recall boolean logical operators in Java… boolean logical operators: &, |, ^ not: ! Show truth tables.

Read more

1. PRESENTATION ON: 1. Logical Operators 2. Precedence Summary 3. Other Control Statements By: -Sanjeev Budha. 2. Logical Operators: • Programming is all ...

Read more

VB'NET Logical Operators and Control structure. ... The PowerPoint PPT presentation: "VB'NET Logical Operators and Control structure" is the property of ...

Read more

Drawings and Presentations Charts (Diagrams) Databases ... OpenOffice.org Basic understands common mathematical, logical, and comparison operators.

Read more

... (3 downto 0) i<=bits2int(b); b<=int2bits(i,4); Built-In Operators Logic operators AND, OR, NAND, NOR ... Document presentation format: On-screen ...

Read more

## Add a comment