

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to demonstrate Prefix Operator using C#?
The increment operator is ++ operator. If used as prefix on a variable, the value of variable gets incremented by 1. After that the value is returned unlike Postfix operator. It is called Prefix increment operator. In the same way the decrement operator works but it decrements by 1.
For example, ++a;
The following is an example demonstrating Prefix increment operator −
Example
using System; class Program { static void Main() { int a, b; a = 10; Console.WriteLine(++a); b = a; Console.WriteLine(a); Console.WriteLine(b); } }
Output
11 11 11
- Related Questions & Answers
- Demonstrate the concept of pointers using C language
- Prefix calculator using stack in JavaScript
- Differentiate between the prefix and postfix forms of the ++ operator in java?
- C++ program to demonstrate exception handling
- Prefix matching in Python using pytrie module
- How to create JavaScript objects using new operator?
- How to query MongoDB using the $ne operator?
- C program to demonstrate fork() and pipe()
- C++ program to demonstrate multi-level inheritance
- C++ program to demonstrate function of macros
- Demonstrate Static Import in Java
- Demonstrate thread priorities in Java
- Prefix sum array in python using accumulate function
- Convert Infix to Prefix Expression
- How to prefix string to a pandas series labels?
Advertisements