Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Próximos SlideShares
Carregando em…5
×

# Operators

2.246 visualizações

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

• Full Name
Comment goes here.

Are you sure you want to Yes No
• Seja o primeiro a comentar

### 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 />