Arithmetic Operators in C# - C# Tutorial 18

Veröffentlicht am: 20 Juli 2020
auf dem Kanal: ChidresTechTutorials
2,611
40

Notes for You:: Arithmetic Operators in C# - C# Tutorial 18
C# provides 5 arithmetic operators to perform arithmetic operations. They are

Addition Operator (+):
gives sum of two numbers.

Subtraction Operator (-):
gives difference between two numbers.

Multiplication Operator (*):
gives product of two numbers.

Division Operator (/):
gives quotient of a complete division operation.

Modulus Operator (%):
remainder of a first division operation.

Example Code:
using System;
namespace ArithmeticOperatorsDemo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(2 + 2); // 4
Console.WriteLine(5 + 2); // 7

Console.WriteLine(5 - 2); // 3
Console.WriteLine(10 - 2); // 8

Console.WriteLine(5 * 2); // 10
Console.WriteLine(10 * 2); // 20

Console.WriteLine(10 / 2); // 5
Console.WriteLine(10 % 2); // 0

Console.WriteLine(11 / (float) 2); // 5.5
Console.WriteLine(11 % 2); // 1

// Console.WriteLine(10 / 0); // division by zero error

Console.ReadKey();

}
}
}

=========================================

Follow the link for next video:
   • Relational Operators in C# - C# Tutor...  

Follow the link for previous video:
   • Operators in C# - C# Tutorial 17  

=========================================

C# Tutorials Playlist:-
   • C# Tutorials  

=========================================
Watch My Other Useful Tutorials:-

C++ Tutorials Playlist:
   • C++ Tutorials  

Java Tutorials Playlist:-
   • Java Tutorials  

C Programming Tutorials Playlist:
   • C Programming Tutorials  

C Practical LAB Exercises Playlist:-
   • C Practical Programs  

=========================================

► Subscribe to our YouTube channel:
   / chidrestechtutorials  

► Visit our Website:
https://www.chidrestechtutorials.com

=========================================
Hash Tags:-
#ChidresTechTutorials #CSharp #CSharpTutorial #CHash #CHashTutorial


Auf dieser Seite können Sie das Online-Video Arithmetic Operators in C# - C# Tutorial 18 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer ChidresTechTutorials 20 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,611 Mal angesehen und es wurde von 40 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!