Postfix and Prefix Operator in C#


Grammarly

More than 40 Lakhs Students and Professionals use Grammarly for their spell and grammar checks. You can register and try for free.

Below is a sample code snippet demonstrating the Postfix and Prefix Operator in C#

using System;

namespace AbundantCode

{

internal class Program

{

//Arithmetic Operators in C#

private static void Main(string[] args)

{

int Input = 100;

Input = Input++;

Console.WriteLine("The output of the AbundantCode is " + Input.ToString());

Input = ++Input;

Console.WriteLine("The output of the AbundantCode is " + Input.ToString());

Input = Input--;

Console.WriteLine("The output of the AbundantCode is " + Input.ToString());

Input = --Input;

Console.WriteLine("The output of the AbundantCode is " + Input.ToString());

Console.ReadLine();

}

}

}
Postfix and Prefix Operator in C#

Grammarly

More than 40 Lakhs Students and Professionals use Grammarly for their spell and grammar checks. You can register and try for free.
%d bloggers like this: