SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Operators in VB.NET www.ustudy.in
Introduction Operator is defined as a symbol that operates the variables and constants to produce a required result. www.ustudy.in
VB.NET Operators Arithmetic operators Comparison operators Logical operators Concatenation operators www.ustudy.in
Arithmetic operators Arithmetic operators are used to perform arithmetic calculations such as addition and subtraction. VB.NET supported arithmetic are listed in the given table. www.ustudy.in
www.ustudy.in
Comparison operators Comparison operators are used to compare two or more values. VB.NET supported comparison operators are listed in the following table. www.ustudy.in
www.ustudy.in
Logical operators Logical operators are used to perform logical operations such as AND, OR, NOT on one or more expressions. www.ustudy.in
AND This operator is used as a conjunction of two conditions. The result of the AND operation is True only if both the conditions are true.       Syntax: Result = Expression1 AND Expression2 www.ustudy.in
Result of AND operation table www.ustudy.in
Example of AND Operator 	Dim a, b, c As Integer 	Dim d As Boolean 	a = 10 	b = 20 	c = 30 d = (a<b) AND (b<c)	‘Returns True’ d = (a>b) AND (b<c)	‘Returns False’ www.ustudy.in
OR This operator is used as a disjunction of two conditions. The result of the OR operator is false only if both the conditions are false.      Syntax: Result = Expression1 OR Expression2 www.ustudy.in
Result of OR operation table www.ustudy.in
Example of OR Operator 	Dim a, b, c As Integer 	Dim d As Boolean 	a = 10 	b = 20 	c = 30 d = (a<b) OR (b>c)	‘Returns True’ d = (a>b) OR (b>c)	‘Returns False’ www.ustudy.in
XOR The result this operator is True only if one of the conditions is true and other is false.       Syntax: Result = Expression1 XOR Expression2 www.ustudy.in
Result of XOR operation table www.ustudy.in
Example of XOR Operator 	Dim a, b, c As Integer 	Dim d As Boolean 	a = 10 	b = 20 	c = 30 d = (a<b) XOR (b<c)	‘Returns False’ d = (a>b) XOR (b<c)	‘Returns True’ www.ustudy.in
NOT This logical operator is used to perform a logical negation on a boolean expression.      Syntax: Result = NOT (boolean Expression) www.ustudy.in
Result of NOT operation table www.ustudy.in
Example of XOR Operator 	Dim a, b, c As Integer 	Dim d As Boolean 	a = 10 	b = 20 	c = NOT (a>b)	‘Returns True’ c = NOT (a<b)	‘Returns False’ www.ustudy.in
AndAlso This operator is same as AND operator but if the first condition is false then the second condition is not checked and the result is false.      Syntax: Result = Expression 1 AndAlso Expression2 www.ustudy.in
OrElse This operator is same as OR operator but if the first condition is true then the second condition is not checked and the result is True.      Syntax: Result = Expression 1 OrElse Expression2 www.ustudy.in
Concatenation operators Concatenation operators are used to join two string values.  & and + are the two concatenation operators available in VB.NET. The operator & is used to concatenate two strings and + is used to add two numbers and concatenate two strings.  www.ustudy.in
Example of concatenation operators MsgBox(“Good” & “Night”)		‘Returns GoodNight’ MsgBox(“Good” + “Night”)		‘Returns GoodNight’ MsgBox(“22” & “33”)			‘Returns 2233’ MsgBox(“22” + “33”)			‘Returns 2233’ MsgBox(22 + 33)			‘Returns 55’ www.ustudy.in
The End 		….. Thank You …… www.ustudy.in

Weitere ähnliche Inhalte

Was ist angesagt?

class and objects
class and objectsclass and objects
class and objects
Payel Guria
 

Was ist angesagt? (20)

Control statements in c
Control statements in cControl statements in c
Control statements in c
 
class and objects
class and objectsclass and objects
class and objects
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
Php string function
Php string function Php string function
Php string function
 
Dbms keys
Dbms keysDbms keys
Dbms keys
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Ternary operator
Ternary operatorTernary operator
Ternary operator
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
List in Python
List in PythonList in Python
List in Python
 
Operator.ppt
Operator.pptOperator.ppt
Operator.ppt
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
Python set
Python setPython set
Python set
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
 
Php array
Php arrayPhp array
Php array
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Arrays
ArraysArrays
Arrays
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 
Infix prefix postfix
Infix prefix postfixInfix prefix postfix
Infix prefix postfix
 

Andere mochten auch

Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
Simon Willison
 
VB Function and procedure
VB Function and procedureVB Function and procedure
VB Function and procedure
pragya ratan
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में
Chand Rook
 

Andere mochten auch (13)

Arrays
ArraysArrays
Arrays
 
JavaScript: The Language
JavaScript: The LanguageJavaScript: The Language
JavaScript: The Language
 
Rediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The LibrariesRediscovering JavaScript: The Language Behind The Libraries
Rediscovering JavaScript: The Language Behind The Libraries
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Procedures functions structures in VB.Net
Procedures  functions  structures in VB.NetProcedures  functions  structures in VB.Net
Procedures functions structures in VB.Net
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
 
INPUT BOX- VBA
INPUT BOX- VBAINPUT BOX- VBA
INPUT BOX- VBA
 
VB Function and procedure
VB Function and procedureVB Function and procedure
VB Function and procedure
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
JavaScript Intro
JavaScript IntroJavaScript Intro
JavaScript Intro
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में
 

Ähnlich wie Operators

C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
jahanullah
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 

Ähnlich wie Operators (20)

C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
Operators
OperatorsOperators
Operators
 
Programming C Part 02
Programming C Part 02Programming C Part 02
Programming C Part 02
 
Operators
OperatorsOperators
Operators
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
Operator 04 (js)
Operator 04 (js)Operator 04 (js)
Operator 04 (js)
 
Chapter 3:Programming with Java Operators and Strings
Chapter 3:Programming with Java Operators and  StringsChapter 3:Programming with Java Operators and  Strings
Chapter 3:Programming with Java Operators and Strings
 
11operator in c#
11operator in c#11operator in c#
11operator in c#
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions Notes
 
Operators In Java Part - 8
Operators In Java Part - 8Operators In Java Part - 8
Operators In Java Part - 8
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Chapter 3 : Programming with Java Operators and Strings
Chapter 3 : Programming with Java Operators and  StringsChapter 3 : Programming with Java Operators and  Strings
Chapter 3 : Programming with Java Operators and Strings
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
Additional Relational Algebra Operations
Additional Relational Algebra OperationsAdditional Relational Algebra Operations
Additional Relational Algebra Operations
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 

Mehr von Then Murugeshwari

Mehr von Then Murugeshwari (20)

Traffic safety
Traffic safetyTraffic safety
Traffic safety
 
P h indicators
P h indicatorsP h indicators
P h indicators
 
Avogadro's law
Avogadro's lawAvogadro's law
Avogadro's law
 
Resonance
ResonanceResonance
Resonance
 
Microwave remote sensing
Microwave remote sensingMicrowave remote sensing
Microwave remote sensing
 
Newton's law
Newton's lawNewton's law
Newton's law
 
Surface tension
Surface tensionSurface tension
Surface tension
 
Hook's law
Hook's lawHook's law
Hook's law
 
Hook's law
Hook's lawHook's law
Hook's law
 
ERP components
ERP componentsERP components
ERP components
 
Database fundamentals
Database fundamentalsDatabase fundamentals
Database fundamentals
 
Mosfet
MosfetMosfet
Mosfet
 
Hiperlan
HiperlanHiperlan
Hiperlan
 
Bluetooth profile
Bluetooth profileBluetooth profile
Bluetooth profile
 
Router
RouterRouter
Router
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Thread priorities
Thread prioritiesThread priorities
Thread priorities
 
Threads
ThreadsThreads
Threads
 
Identifiers
Identifiers Identifiers
Identifiers
 
Virtual ground
Virtual groundVirtual ground
Virtual ground
 

Operators

  • 1. Operators in VB.NET www.ustudy.in
  • 2. Introduction Operator is defined as a symbol that operates the variables and constants to produce a required result. www.ustudy.in
  • 3. VB.NET Operators Arithmetic operators Comparison operators Logical operators Concatenation operators www.ustudy.in
  • 4. Arithmetic operators Arithmetic operators are used to perform arithmetic calculations such as addition and subtraction. VB.NET supported arithmetic are listed in the given table. www.ustudy.in
  • 6. Comparison operators Comparison operators are used to compare two or more values. VB.NET supported comparison operators are listed in the following table. www.ustudy.in
  • 8. Logical operators Logical operators are used to perform logical operations such as AND, OR, NOT on one or more expressions. www.ustudy.in
  • 9. AND This operator is used as a conjunction of two conditions. The result of the AND operation is True only if both the conditions are true. Syntax: Result = Expression1 AND Expression2 www.ustudy.in
  • 10. Result of AND operation table www.ustudy.in
  • 11. Example of AND Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = 30 d = (a<b) AND (b<c) ‘Returns True’ d = (a>b) AND (b<c) ‘Returns False’ www.ustudy.in
  • 12. OR This operator is used as a disjunction of two conditions. The result of the OR operator is false only if both the conditions are false. Syntax: Result = Expression1 OR Expression2 www.ustudy.in
  • 13. Result of OR operation table www.ustudy.in
  • 14. Example of OR Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = 30 d = (a<b) OR (b>c) ‘Returns True’ d = (a>b) OR (b>c) ‘Returns False’ www.ustudy.in
  • 15. XOR The result this operator is True only if one of the conditions is true and other is false. Syntax: Result = Expression1 XOR Expression2 www.ustudy.in
  • 16. Result of XOR operation table www.ustudy.in
  • 17. Example of XOR Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = 30 d = (a<b) XOR (b<c) ‘Returns False’ d = (a>b) XOR (b<c) ‘Returns True’ www.ustudy.in
  • 18. NOT This logical operator is used to perform a logical negation on a boolean expression. Syntax: Result = NOT (boolean Expression) www.ustudy.in
  • 19. Result of NOT operation table www.ustudy.in
  • 20. Example of XOR Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = NOT (a>b) ‘Returns True’ c = NOT (a<b) ‘Returns False’ www.ustudy.in
  • 21. AndAlso This operator is same as AND operator but if the first condition is false then the second condition is not checked and the result is false. Syntax: Result = Expression 1 AndAlso Expression2 www.ustudy.in
  • 22. OrElse This operator is same as OR operator but if the first condition is true then the second condition is not checked and the result is True. Syntax: Result = Expression 1 OrElse Expression2 www.ustudy.in
  • 23. Concatenation operators Concatenation operators are used to join two string values. & and + are the two concatenation operators available in VB.NET. The operator & is used to concatenate two strings and + is used to add two numbers and concatenate two strings. www.ustudy.in
  • 24. Example of concatenation operators MsgBox(“Good” & “Night”) ‘Returns GoodNight’ MsgBox(“Good” + “Night”) ‘Returns GoodNight’ MsgBox(“22” & “33”) ‘Returns 2233’ MsgBox(“22” + “33”) ‘Returns 2233’ MsgBox(22 + 33) ‘Returns 55’ www.ustudy.in
  • 25. The End ….. Thank You …… www.ustudy.in