logging in or signing up C++,logical statement and assignment statement aSGuest103140 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 54 Category: Education License: All Rights Reserved Like it (0) Dislike it (0) Added: June 30, 2011 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Switch statement Logical Statement Assignment Statement : Switch statement Logical Statement Assignment Statement Computer programming C++Instructor: Instructor Sir Aamir JamshidCrew Members: Crew Members Azeem Mumtaz Saqib Munawar Hafiz Ashfaq M.Zeeshan ArshadLogical Statements: 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: “&&”Working: WorkingExample: ExampleOutput: Output Enter the first number 1 Enter the second number 0 0Slide 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: “| |”Working: WorkingExample: ExampleOutput : Output Enter the first number 1 Enter the second number 0 1Not Operator: Not Operator It is the reverses the result of condition It gives True if condition is false It gives false if condition is true Symbol: “!”Example: Example ≡ File Edit Search Run Compile Debug Project Options Window Help ╔═[■]════════════════════════════ NONAME00.CPP ══════════════════════════1═[↑]═╗ ║#include< iostream.h > ▲ ║#include< conio.h > ■ ║void main() ▒ ║{ ▒ ║ clrscr (); ▒ ║ int a; ▒ ║ cout <<"Enter the number"<< endl ; ▒ ║ cin >>a; ▒ ║if(a%2!=0) ▒ ║ cout <<"the number is odd"; ▒ ║else ▒ ║ cout <<"the number is even"; ▒ ║ getch (); ▒ ║} ▼ ╚═☼════ 14:3 ═════◄■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒►─┘ ┌────────────────────────────────── Message ─────────────────────────────2─────┐ │•Compiling NONAME00.CPP: │ │ Linking TCDEF.EXE: │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ F1 Help Alt-F8 Next Msg Alt-F7 Prev Msg Alt-F9 Compile F9 Make F10 MenuOutput: Output Enter the number 8 The number is evenHafiz Ashfaq: Hafiz AshfaqAssignment Statement : 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.Syntax : Syntax Variable=Expression Examples A=100; C= a+b ; X=c-d+10;LVALUE & RVALUE: 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 .Example: Example ≡ File Edit Search Run Compile Debug Project Options Window Help ╔═[■]════════════════════════════ NONAME00.CPP ══════════════════════════1═[↑]═╗ ║#include< iostream.h > ▲ ║#include< conio.h > ■ ║void main() ▒ ║{ clrscr (); ▒ ║ int a,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 Prev Msg Alt-F9 Compile F9 Make F10 MenuM.Zeeshan Arshad: M.Zeeshan ArshadExample: ExampleOutput: Output a+b =15 a-b=5 a*b=50 a/b=2 a%b =0Compound Statement Operator: 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+10Saqib munawar: Saqib munawarSwitch Statement: 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 executedSyntax: SyntaxExample: ExampleNested Switch: Nested Switch You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
C++,logical statement and assignment statement aSGuest103140 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 54 Category: Education License: All Rights Reserved Like it (0) Dislike it (0) Added: June 30, 2011 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Switch statement Logical Statement Assignment Statement : Switch statement Logical Statement Assignment Statement Computer programming C++Instructor: Instructor Sir Aamir JamshidCrew Members: Crew Members Azeem Mumtaz Saqib Munawar Hafiz Ashfaq M.Zeeshan ArshadLogical Statements: 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: “&&”Working: WorkingExample: ExampleOutput: Output Enter the first number 1 Enter the second number 0 0Slide 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: “| |”Working: WorkingExample: ExampleOutput : Output Enter the first number 1 Enter the second number 0 1Not Operator: Not Operator It is the reverses the result of condition It gives True if condition is false It gives false if condition is true Symbol: “!”Example: Example ≡ File Edit Search Run Compile Debug Project Options Window Help ╔═[■]════════════════════════════ NONAME00.CPP ══════════════════════════1═[↑]═╗ ║#include< iostream.h > ▲ ║#include< conio.h > ■ ║void main() ▒ ║{ ▒ ║ clrscr (); ▒ ║ int a; ▒ ║ cout <<"Enter the number"<< endl ; ▒ ║ cin >>a; ▒ ║if(a%2!=0) ▒ ║ cout <<"the number is odd"; ▒ ║else ▒ ║ cout <<"the number is even"; ▒ ║ getch (); ▒ ║} ▼ ╚═☼════ 14:3 ═════◄■▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒►─┘ ┌────────────────────────────────── Message ─────────────────────────────2─────┐ │•Compiling NONAME00.CPP: │ │ Linking TCDEF.EXE: │ │ │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────┘ F1 Help Alt-F8 Next Msg Alt-F7 Prev Msg Alt-F9 Compile F9 Make F10 MenuOutput: Output Enter the number 8 The number is evenHafiz Ashfaq: Hafiz AshfaqAssignment Statement : 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.Syntax : Syntax Variable=Expression Examples A=100; C= a+b ; X=c-d+10;LVALUE & RVALUE: 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 .Example: Example ≡ File Edit Search Run Compile Debug Project Options Window Help ╔═[■]════════════════════════════ NONAME00.CPP ══════════════════════════1═[↑]═╗ ║#include< iostream.h > ▲ ║#include< conio.h > ■ ║void main() ▒ ║{ clrscr (); ▒ ║ int a,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 Prev Msg Alt-F9 Compile F9 Make F10 MenuM.Zeeshan Arshad: M.Zeeshan ArshadExample: ExampleOutput: Output a+b =15 a-b=5 a*b=50 a/b=2 a%b =0Compound Statement Operator: 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+10Saqib munawar: Saqib munawarSwitch Statement: 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 executedSyntax: SyntaxExample: ExampleNested Switch: Nested Switch