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
On this page of the site you can watch the video online Arithmetic Operators in C# - C# Tutorial 18 with a duration of hours minute second in good quality, which was uploaded by the user ChidresTechTutorials 20 July 2020, share the link with friends and acquaintances, this video has already been watched 2,611 times on youtube and it was liked by 40 viewers. Enjoy your viewing!