6. Logical Statements AND operator It is used to evaluate two conditions . It produces true result if both conditions are true It produces false if any one condition is false Symbol: “&&”
10. OR operator It is used to evaluate two conditions It produces true if either condition is true It produces false result if both conditions are false Symbol: “| |”
18. Assignment Statement A statement that assigns a value to a variable is known as assignment statement. The assignment =is used in assignment statement to assign a value or computational result to a variable. The name of variable is written on the left side of assignment operator and the value is written on the right side. The value can be a constant ,variable ,expression or a function.
20. LVALUE & RVALUE An L value is an operand that can be written on the left side of assignment operator=it must always be a single value. An rvalue is an operand that can be written on the right side of assignment statement=. All Lvaues can be used as Rvalues.
21. Example ≡ File Edit Search Run Compile Debug Project Options Window Help ╔═[■]════════════════════════════ NONAME00.CPP ══════════════════════════1═[↑]═╗ ║#include<iostream.h> ▲ ║#include<conio.h> ■ ║void main() ▒ ║{clrscr(); ▒ ║inta,b; ▒ ║a=10; ▒ ║b=5; ▒ ║cout<<"a+b="<<a+b<<endl; ▒ ║cout<<"a-b="<<a-b<<endl; ▒ ║cout<<"a*b="<<a*b<<endl; ▒ ║cout<<"a/b="<<a/b<<endl; ▒ ║cout<<"a%b="<<a%b<<endl; ▒ ║getch(); ▒ ║} ▼ ╚═☼════ 14:2 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒►─┘ ┌────────────────────────────────── Message ─────────────────────────────2─────┐ │•Compiling NONAME00.CPP: │ │ Linking NONAME00.EXE: │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ F1 Help Alt-F8 Next Msg Alt-F7 PrevMsg Alt-F9 Compile F9 Make F10 Menu
25. Compound Statement Operator It combines the assignment statement with arithmetic operator Syntax:Variable op= expression Variable: The variable to assign a value Op: Any arithmetic operator Expression: It can be a constant, variable or arithmetic operation Example: N+=10 ~ N=N+10
27. Switch Statement It is a conditional structure It is an alternative of “nested if” It is used when there are many choices are available and we need one to be executed