SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

Data types in python
Data types in pythonData types in python
Data types in pythonRaginiJain21
 
Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause Deepam Aggarwal
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypesVarun C M
 
Control structure C++
Control structure C++Control structure C++
Control structure C++Anil Kumar
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in JavaNiloy Saha
 
concept of Array, 1D & 2D array
concept of Array, 1D & 2D arrayconcept of Array, 1D & 2D array
concept of Array, 1D & 2D arraySangani Ankur
 
Constructor and Types of Constructors
Constructor and Types of ConstructorsConstructor and Types of Constructors
Constructor and Types of ConstructorsDhrumil Panchal
 
04 Handling Exceptions
04 Handling Exceptions04 Handling Exceptions
04 Handling Exceptionsrehaniltifat
 
Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder Vishvesh Jasani
 

La actualidad más candente (20)

Method overriding
Method overridingMethod overriding
Method overriding
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause Group By, Having Clause and Order By clause
Group By, Having Clause and Order By clause
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
Arrays
ArraysArrays
Arrays
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Linked List
Linked ListLinked List
Linked List
 
concept of Array, 1D & 2D array
concept of Array, 1D & 2D arrayconcept of Array, 1D & 2D array
concept of Array, 1D & 2D array
 
Constructor and Types of Constructors
Constructor and Types of ConstructorsConstructor and Types of Constructors
Constructor and Types of Constructors
 
Conditional statements
Conditional statementsConditional statements
Conditional statements
 
Infix to postfix conversion
Infix to postfix conversionInfix to postfix conversion
Infix to postfix conversion
 
04 Handling Exceptions
04 Handling Exceptions04 Handling Exceptions
04 Handling Exceptions
 
Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder Nesting of if else statement & Else If Ladder
Nesting of if else statement & Else If Ladder
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Vb basics
Vb basicsVb basics
Vb basics
 
Python tuple
Python   tuplePython   tuple
Python tuple
 

Destacado

JavaScript: The Language
JavaScript: The LanguageJavaScript: The Language
JavaScript: The LanguageEngage Software
 
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 LibrariesSimon Willison
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptfoOfys Solutions
 
Procedures functions structures in VB.Net
Procedures  functions  structures in VB.NetProcedures  functions  structures in VB.Net
Procedures functions structures in VB.Nettjunicornfx
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variablesteach4uin
 
VB Function and procedure
VB Function and procedureVB Function and procedure
VB Function and procedurepragya ratan
 
Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual BasicSangeetha Sg
 
JavaScript Intro
JavaScript IntroJavaScript Intro
JavaScript IntroEric Brown
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript ProgrammingSehwan Noh
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में Chand Rook
 

Destacado (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
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में
 

Similar a Operators

C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)jahanullah
 
Operators
OperatorsOperators
OperatorsKamran
 
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++Himanshu Kaushik
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++bajiajugal
 
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 StringsIt Academy
 
11operator in c#
11operator in c#11operator in c#
11operator in c#Sireesh K
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions NotesProf Ansari
 
Operators In Java Part - 8
Operators In Java Part - 8Operators In Java Part - 8
Operators In Java Part - 8MuhammadAtif231
 
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 StringsIt Academy
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programmingsavitamhaske
 
Additional Relational Algebra Operations
Additional Relational Algebra OperationsAdditional Relational Algebra Operations
Additional Relational Algebra OperationsA. S. M. Shafi
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++Neeru Mittal
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7REHAN IJAZ
 

Similar a 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
 

Más de 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