Java Program #18 - Print Pyramid Star Pattern in Java

Поделиться
HTML-код
  • Опубликовано: 13 дек 2024

Комментарии • 11

  • @Binsi784
    @Binsi784 11 месяцев назад +2

    Thank u. I get the logic easily, expecting more vedios❤

    • @programmingforbeginners7392
      @programmingforbeginners7392  10 месяцев назад

      Welcome
      Watch my other videos here:
      Java Tutorial Playlist with Java programs:
      ruclips.net/p/PLhyraTKIsw5_WemVMvshNm-0aC7zfISCO&si=Fe1e2FqEFmCeHQDX

  • @MohammadAkramBPW
    @MohammadAkramBPW 9 месяцев назад +3

    Thank you sir 🤗🤗🤗

  • @damsihak2
    @damsihak2 8 месяцев назад +1

    Very well explained

  • @thatchanamoorthy.g9765
    @thatchanamoorthy.g9765 2 года назад +1

    Can you plz answer this question
    doors algorithm let's assume there are n number of doors number from 1 to n, initially all doors are closed. all these doors were connected to wireless switching system. the doors can be opened or closed only by the switching system. this system performs a certain algorithm to open and close the doors example: let's consider (n=5) 5 doors which are initially closed. now the system performs the algorithm for n number of iterations in this case 5. iteration 1: "each door number which are divisible by 1 is toggled", currently all doors are closed, and all numbers from 1 to 5 is divisible by 1 so all doors are opened. so after iteration 1 the doors which are open is 1,2,3,4,5 iteration 2: "each door number which are divisible by 2 is toggled", now the numbers divisible by 2 from 1 to 5 are 2,4. these doors alone be toggled so after iteration 2 the doors which are open is 1,3,5 and doors which are closed are 2,4 iteration 3: "each door number which are divisible by 3 is toggled", now the numbers divisible by 3 from 1 to 5 are 3, these door alone be toggled, so previously 3 is opened now it is closed so after iteration 3 the doors which are open is 1,5 and doors which are closed are 2,3,4 iteration 4: "each door number which are divisible by 4 is toggled" now the number divisible by 4 in 1 to 5 is only 4 which is only be toggled, so previously 4 is closed now it is opened so after iteration 4 the doors which are open is 1,4,5 and doors which are closed are 2,3 iteration 5: "each door number which are divisible by 5 is toggled", now the numbers divisible by 5 from 1 to 5 are 5, these door alone be toggled, so previously 5 is opened now it is closed so after iteration 5 the doors which are open is 1,4 and doors which are closed are 2,3,5 after all 5 iterations the result is the doors opened 1,4 and doors closed: 2,3,5
    sample input and output: 1) n=10=> opened doors =[1,4,9] closed doors = [2,3,5,6,7,8,10] 2)n=15=> opened doors =[1,4,9] closed doors = [2,3,5,6,7,8,10,11,12,13,14,15]

  • @johncarlozapanta9856
    @johncarlozapanta9856 2 месяца назад +1

    My head hurts

  • @manojkumar-xy5vn
    @manojkumar-xy5vn 9 месяцев назад +1

    You are too fast bro

  • @kannandivakar3313
    @kannandivakar3313 9 месяцев назад

    Error codes