C# arithmetic operators 🧮
Вставка
- Опубліковано 2 лип 2021
- C# arithmetic operators tutorials example explained
#C# #arithmetic #operators
using System;
namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
int friends = 5;
friends = friends + 1;
//friends += 1;
//friends++;
//friends = friends - 1;
//friends -= 1;
//friends--;
//friends = friends * 2;
//friends *= 2;
//friends = friends / 2;
//friends /= 2;
//int remainder = friends % 2;
//Console.WriteLine(remainder);
Console.WriteLine(friends);
Console.ReadKey();
}
}
} - Наука та технологія
using System;
namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
int friends = 5;
friends = friends + 1;
//friends += 1;
//friends++;
//friends = friends - 1;
//friends -= 1;
//friends--;
//friends = friends * 2;
//friends *= 2;
//friends = friends / 2;
//friends /= 2;
//int remainder = friends % 2;
//Console.WriteLine(remainder);
Console.WriteLine(friends);
Console.ReadKey();
}
}
}
Thank you bro! I’ve been self-taught with C# for 6+ years now, using it off and on, and I found your tutorials yesterday. They are so clear and concise and great for not only beginners but more experienced programmers as well.
Although I’ve been using the += operator for many years, I’ve always wondered *why* the += operator worked, and you explained it better than anyone else. Thanks bro 💯
6+ yrs experience and still lagging basic of programming. nice joke
@@nikeshgupta1241 he didn't say 6 years experience
been following all the c# videos, ty for the quick and snappy tutorials, been very helpful :)
bro explaining better than my college teacher
i just started this course local
and you earned sub just for showing CW+Tab :))
Thanks for the video Bro. It helps a lot.
Thanks!
Thanks
here to help the algorithm bro
noice
Steve literally divided the friends💀
Praise the algorithm!
I do not get what % does
Hi maben, it returns the old school remainder of a division. 10 divided by 3 = 3 Remainder 1, so 10%3 would return 1. Similarly, 10 divided by 5 = 2 Remainder 0 so the 10%5 would return 0. This is great for determining if a number is a factor of another (would return 0) or for having something in a loop occur over regular intervals. In a loop where x increases by 1 each time through, testing for x%3 = 0 would let you have something happen only every third time through the loop. Very useful in certain situations. 🙂
Hi Sir, can u guide me i hav 3 doubts.
1. Can we perform multi operation (+,-,*)using one instance method?
2.can we pass different values in instance method using same object or different object
3 In Method Overloading , can we call at time to all methods wid different parameter?
Plz ansr me Sir
lesson check]😇
yeahh bro code
Smah the like button bros