Arithmetic Operators in C# - C# Tutorial 18

Опубликовано: 20 Июль 2020
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн Arithmetic Operators in C# - C# Tutorial 18 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ChidresTechTutorials 20 Июль 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 2,611 раз и оно понравилось 40 зрителям. Приятного просмотра!