Add Assigment for both number and string value : Operators « Language Basics « C# / C Sharp
- C# / C Sharp
- Language Basics
- Operators
Add Assigment for both number and string value
using System;
class AddAssigment
{
static void Main()
{
//addition
int a = 5;
a += 6;
Console.WriteLine(a);
//string concatenation
string s = "Hello";
s += " world.";
Console.WriteLine(s);
}
}
Related examples in the same category