Horje
Increment operator c# Code Example
Increment operator c#
//Decrement operator (--)
int i = 3;
Console.WriteLine(i);   // output: 3
Console.WriteLine(i--); // output: 3
Console.WriteLine(i);   // output: 2

double a = 1.5;
Console.WriteLine(a);   // output: 1.5
Console.WriteLine(--a); // output: 0.5
Console.WriteLine(a);   // output: 0.5
//Increment operator (++)
int i = 3;
Console.WriteLine(i);   // output: 3
Console.WriteLine(i++); // output: 3
Console.WriteLine(i);   // output: 4

double a = 1.5;
Console.WriteLine(a);   // output: 1.5
Console.WriteLine(++a); // output: 2.5
Console.WriteLine(a);   // output: 2.5
c# increment by 1
int i = 0;
i++; // Adds 1 to i
i = i + 1; // Adds 1 to i
increment and decrement in c#
Console.WriteLine("----incriment and decrement in c# -----");
x--;
y++;
Console.WriteLine(x);
Console.WriteLine(y);




Csharp

Related
unity get all components in gameobject Code Example unity get all components in gameobject Code Example
play sound unity Code Example play sound unity Code Example
c# array of strings Code Example c# array of strings Code Example
unity setparent Code Example unity setparent Code Example
C# get size of file Code Example C# get size of file Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8