Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
.net Q4
// WAP to show the use of operators(unary ,Increment,Decrement) //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int a = 10, res; // post-increment example: // res is assigned 10 only, // a is not updated yet res = a++; //a becomes 11 now Console.WriteLine("a is {0} and res is {1}", a, res); // post-decrement example: // res is assigned 11 only, a is not updated yet res = a--; //a becomes 10 now Console.WriteLine("a is {0} and res is {1}", a, res); // pre-increment example: // res is assigned 11 now since a // is updated here itself res = ++a; // a and res have same values = 11 Console.WriteLine("a is {0} and res is {1}", a, res); // pre-decrement example: // res is assigned 10 only since // a is updated here itself res = --a; // a and res have same values = 10 Console.WriteLine("a is {0} and res is {1}",a, res); } } }
run
|
edit
|
history
|
help
0
RNJHEFDSS VASX
caleb
concrete class with inheritance
Quicksort
Using Events/Delegates to Subscribe To A Service - Emails
Linq Func Action
Fórum Multiple Tests Returning Error Message
Dungeon Game
Xml in C#
combof123usingloop