Saturday, October 27, 2007

How to use Operators in VB.NET & C#?

Operators


In vb.net & c# language Operators are differ. Code of Operators of vb.net & c# language.

____________________________________________________________________

VB.NET

Comparison
= < > <= >= <>

Arithmetic
+ - * /
Mod
\ (integer division)
^ (raise to a power)

Assignment
= += -= *= /= \= ^= <<= >>= &=

Bitwise
And Or Xor Not << >>

Logical
AndAlso OrElse And Or Xor Not

Note: AndAlso and OrElse perform short-circuit logical evaluations

String Concatenation
&

------------------------------------------------------------------------------------------------

C#

Comparison
== < > <= >= !=

Arithmetic
+ - * /
% (mod)
/ (integer division if both operands are ints)
Math.Pow(x, y)

Assignment
= += -= *= /= %= &= |= ^= <<= >>= ++ --

Bitwise
& | ^ ~ << >>

Logical
&& || & | ^ !

Note: && and || perform short-circuit logical evaluations

String Concatenation
+

-------------------------------------------------------------------------------------------------

Note: This code applicable for both desktop and web application.

-------------------------------------------------------------------------------------------------

No comments: