Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
.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
Please
log in
to post a comment.
1. Basics: primitive data types
Execution flow of static and normal constructor of base and derived class.
blanaced parenthes
Rijndael AES key generator C#
Ftg
Lambdas
Vin Generator V1
Program.cs
Nested Namespace
Prsonal informashin
stackse - search stackoverflow differently
Please log in to post a comment.