Operators in VB.NET<br />www.ustudy.in<br />
Introduction<br />Operator is defined as a symbol that operates the variables and constants to produce a required result.<...
VB.NET Operators<br />Arithmetic operators<br />Comparison operators<br />Logical operators<br />Concatenation operators<b...
Arithmetic operators<br />Arithmetic operators are used to perform arithmetic calculations such as addition and subtractio...
www.ustudy.in<br />
Comparison operators<br />Comparison operators are used to compare two or more values.<br />VB.NET supported comparison op...
www.ustudy.in<br />
Logical operators<br />Logical operators are used to perform logical operations such as AND, OR, NOT on one or more expres...
AND<br />This operator is used as a conjunction of two conditions. The result of the AND operation is True only if both th...
Result of AND operation table<br />www.ustudy.in<br />
Example of AND Operator<br />	Dim a, b, c As Integer<br />	Dim d As Boolean<br />	a = 10<br />	b = 20<br />	c = 30<br />d ...
OR<br />This operator is used as a disjunction of two conditions. The result of the OR operator is false only if both the ...
Result of OR operation table<br />www.ustudy.in<br />
Example of OR Operator<br />	Dim a, b, c As Integer<br />	Dim d As Boolean<br />	a = 10<br />	b = 20<br />	c = 30<br />d =...
XOR<br />The result this operator is True only if one of the conditions is true and other is false.<br />      Syntax:<br ...
Result of XOR operation table<br />www.ustudy.in<br />
Example of XOR Operator<br />	Dim a, b, c As Integer<br />	Dim d As Boolean<br />	a = 10<br />	b = 20<br />	c = 30<br />d ...
NOT<br />This logical operator is used to perform a logical negation on a boolean expression.<br />     Syntax:<br />Resul...
Result of NOT operation table<br />www.ustudy.in<br />
Example of XOR Operator<br />	Dim a, b, c As Integer<br />	Dim d As Boolean<br />	a = 10<br />	b = 20<br />	c = NOT (a>b)	...
AndAlso<br />This operator is same as AND operator but if the first condition is false then the second condition is not ch...
OrElse<br />This operator is same as OR operator but if the first condition is true then the second condition is not check...
Concatenation operators<br />Concatenation operators are used to join two string values. <br />& and + are the two concate...
Example of concatenation operators<br />MsgBox(“Good” & “Night”)		‘Returns GoodNight’<br />MsgBox(“Good” + “Night”)		‘Retu...
The End<br />		….. Thank You ……<br />www.ustudy.in<br />
Upcoming SlideShare
Loading in...5
×

Operators

814

Published on

This Presentation has the details about the Operators in VB.NET..

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
814
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Operators

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

    Clipping is a handy way to collect important slides you want to go back to later.

×