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();
    }
    }
    }
  • Наука та технологія

КОМЕНТАРІ • 20

  • @BroCodez
    @BroCodez  3 роки тому +5

    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();
    }
    }
    }

  • @eerice704
    @eerice704 Рік тому +5

    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 💯

    • @nikeshgupta1241
      @nikeshgupta1241 7 місяців тому +3

      6+ yrs experience and still lagging basic of programming. nice joke

    • @damperemu4445
      @damperemu4445 3 місяці тому

      @@nikeshgupta1241 he didn't say 6 years experience

  • @Milkshaco
    @Milkshaco 2 роки тому

    been following all the c# videos, ty for the quick and snappy tutorials, been very helpful :)

  • @keak3753
    @keak3753 2 дні тому

    bro explaining better than my college teacher

  • @zulfugarhuseynli4858
    @zulfugarhuseynli4858 8 місяців тому

    i just started this course local
    and you earned sub just for showing CW+Tab :))

  • @spartanranger
    @spartanranger 3 роки тому

    Thanks for the video Bro. It helps a lot.

  •  3 роки тому +1

    Thanks!

  • @ayushmansingh3700
    @ayushmansingh3700 3 роки тому +1

    Thanks

  • @K4vin60
    @K4vin60 5 місяців тому

    here to help the algorithm bro

  • @budderrar5751
    @budderrar5751 Рік тому

    noice

  • @mrcatpfp
    @mrcatpfp Рік тому +1

    Steve literally divided the friends💀

  • @WickedJackThe1
    @WickedJackThe1 Рік тому

    Praise the algorithm!

  • @guarryReal
    @guarryReal Рік тому +2

    I do not get what % does

    • @tubetimeline
      @tubetimeline 6 місяців тому +5

      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. 🙂

  • @kavitasharma-yr2gc
    @kavitasharma-yr2gc Рік тому

    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

  • @whitedinamo
    @whitedinamo 2 роки тому

    lesson check]😇

  • @azhanisyahputra9867
    @azhanisyahputra9867 2 роки тому

    yeahh bro code

  • @v4t0z
    @v4t0z 2 роки тому

    Smah the like button bros