C# Tutorial For Beginners 2024 - 7. If/Else

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 9

  • @nofal2031
    @nofal2031 Місяць тому

    thanks a lot for this i wanted actually to check other playlists but i decided to go through this first and i don't regret it

  • @forfancyssake7485
    @forfancyssake7485 6 місяців тому

    Great series i've never done any programming before but im following along very easily. Love the unexpected jokes at the beginning.

  • @laser7585
    @laser7585 7 днів тому

    im confused, i cant get my visual studio code to show me the suggestions when you type "Console", or "Console.". Its not showing any list of possible properties of "Console"
    I have tried installing intellisense, but it doesnt look like yours, and its suggestions are not very helpful. yours seem very helpful in my eyes. but idk.
    I look forward to your answer :D

    • @TeddySmithDev
      @TeddySmithDev  7 днів тому

      you can also try intalling c# dev kit. the only other thin i know without looking at it directly is to restart intellisense.

  • @YTFunobbyYT
    @YTFunobbyYT 3 місяці тому +1

    i don't quite understand the 'if' statements.. if i put: if... write... else if... write... wouldn't it be the same to if... write... if... write...?

    • @TeddySmithDev
      @TeddySmithDev  3 місяці тому +1

      Yeah that’s it lol 👍

    • @nofal2031
      @nofal2031 Місяць тому

      i am new in this , but i believe when write else , once one of them accepted the console skip the others
      var i =3;
      if (i>1)
      {
      System.Console.WriteLine("great");
      }
      elseif (i>2)
      {
      System.Console.WriteLine("too great");
      }
      else
      {
      System.Console.WriteLine("oh no");
      }
      try this then remove else and you will see

    • @sayandahiya2461
      @sayandahiya2461 27 днів тому +1

      Basically, when the if condition is true, the else if condition is not checked and it is not executed. in the second case, when if is true, the second if will still be checked and if that is true, then its code will be executed.

    • @laser7585
      @laser7585 7 днів тому

      in my experience its not quite the same. when you write if(true) and then else if(true) then the code will only execute the first "if" statement. but if you write "If(false)" then "else if(true)" the code will not execute the first "if" only the "else if". so if you where to write "if(true)" and then "if(true)" it would be two different statements, where the code executes both.