C Practical and Assignment Programs-Pattern Printing 9

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

ความคิดเห็น • 142

  • @ZaiiZ3ro
    @ZaiiZ3ro 6 ปีที่แล้ว +5

    dude you're a life saver !!!

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @nikhilgoyal8340
    @nikhilgoyal8340 8 ปีที่แล้ว +3

    Here for printing spaces in the second case we can use the same for loop as used above that is :::
    for(colSpace = totalRows-row ; colSpace >=1 ; colSpace--)
    In the second for loop since we have started counting rows from 4 the same logic for printing spaces will work.

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @deepaksuri8423
    @deepaksuri8423 7 ปีที่แล้ว +3

    I looking for help with the pattern of : Seven lines of output as follows: The first consists of 3 spaces followed by a star. The second line consists of 2 spaces followed by a 3 stars. The third consists of one space followed by 5 stars, and the fourth consists just of 7 stars. The fifth line is identical to third, th sixth to the second and the seventh to the first.

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @SmartProgramming
    @SmartProgramming 6 ปีที่แล้ว +1

    awesome work sir, keep going, best wishes for future 👍👍

  • @MS-rl7rh
    @MS-rl7rh 3 ปีที่แล้ว

    Thank you sir, it's very helpful

  • @SaumyaSharma007
    @SaumyaSharma007 4 ปีที่แล้ว +1

    Thanks man 👍 for the concept....

  • @arilee5450
    @arilee5450 10 ปีที่แล้ว +1

    Thank you so much for your detailed explanation. it was extremly helpful!

    • @ItTimetotravel
      @ItTimetotravel 4 ปีที่แล้ว

      th-cam.com/video/dWIeTpR2Nws/w-d-xo.html for reverse pattern for beginner

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @sunilsharma9611
    @sunilsharma9611 8 ปีที่แล้ว +1

    Very very thanks for helping .

  • @deepaagrawal8653
    @deepaagrawal8653 10 ปีที่แล้ว +1

    thanks for making me to take intrest in learning in pattern only becoz of ur awesome video

  • @justarandompersonontheinte9818
    @justarandompersonontheinte9818 4 ปีที่แล้ว

    Does this code uses recursion?

  • @wethecomputerguys9903
    @wethecomputerguys9903  10 ปีที่แล้ว

    @V Lak Here is the link to the diamond pattern. wethecomputerguys.com/2014/09/08/pattern-printing-28/

  • @cafafans
    @cafafans 5 ปีที่แล้ว

    I saw so many comments complaining; I decided to help you guys; for anyone that care, here is a link to my Github Repo. You can download all source codes. If you have any question; feel free to ask.
    github.com/ElectronicMoney/PatternPrinterCProgramming

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @malkeetsingh8849
    @malkeetsingh8849 9 ปีที่แล้ว

    Marvellous guys.

  • @serajhassan545
    @serajhassan545 6 ปีที่แล้ว

    can u write code only using 3 loops that will print at a time instead of writing two times for each parts because its not look good.

  • @apsietese8718
    @apsietese8718 3 ปีที่แล้ว

    Thank you

  • @lynetsvotwa3704
    @lynetsvotwa3704 9 ปีที่แล้ว +1

    please make the programs simple and i need a program to accept m*n matrix and generate a (m+1)(n+1)

  • @DannyKnot
    @DannyKnot 9 ปีที่แล้ว +1

    What if instead of using white spaces I wanted to use "+" ?

  • @abhitasan
    @abhitasan 9 ปีที่แล้ว

    Can you provide me a code whose pattern resembles to a diamond and in between that i have to write AMU ,means in the middle line ..

  • @esomcmuffin8989
    @esomcmuffin8989 10 ปีที่แล้ว

    Would you be able to write this code, except take in user input for the middle row and have a minimum of 2 stars in each row? Im having a lot of trouble in doing so.
    Thanks

    • @wethecomputerguys9903
      @wethecomputerguys9903  10 ปีที่แล้ว

      Eso McMuffin I dint get your doubt. can u send me a sample input / output for your question?

    • @esomcmuffin8989
      @esomcmuffin8989 10 ปีที่แล้ว

      So I would like the program to accept user input for the middle row and how many rows on top and below the middle as well.
      so if user enter 6 for middle row and 4 on top:
      **
      ****
      ******
      ****
      **
      also, there cannot be less than 2 asterisks per row

  • @skylar6268
    @skylar6268 8 ปีที่แล้ว

    Sir , in the first nested loop to print * - last video u told the logic is.. for(colstar=1;colstar

    • @skylar6268
      @skylar6268 8 ปีที่แล้ว

      i got it :P tq !

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @muwangasulaiman9246
    @muwangasulaiman9246 6 ปีที่แล้ว

    hey write for me a program which prints 6 stars in the first column,4 in the second,3 in the third,2 in the forth.remember there are 8 columns and 6 rows.but the forth row is printed throughout.am waiting thanks

  • @zareensayed6922
    @zareensayed6922 3 ปีที่แล้ว

    Thanks 😊

  • @muhammadsheharyar4105
    @muhammadsheharyar4105 7 ปีที่แล้ว

    you are awsome bro ......realy a helpfull video for my assgnment..keep it up

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @zekosalemeh4135
    @zekosalemeh4135 7 ปีที่แล้ว

    hey i saw all the video you install and i liked i want to know what to do if my dev c++ make cmd run then close without show me the solution

  • @khanzadaasad4127
    @khanzadaasad4127 8 ปีที่แล้ว +1

    how to make program for this output??
    *
    * *
    * *
    * *
    * *
    * *
    *

    • @Junaidkhan-ti8qd
      @Junaidkhan-ti8qd 8 ปีที่แล้ว

      +khanzada Asad hahahahahaha hpala e jora wa kana

    • @tryingtocorrect
      @tryingtocorrect 8 ปีที่แล้ว +1

      +khanzada Asad This is just a quick one, surely can be done in a better way, but it works (size is the size of the figure):
      #include
      using namespace std;
      int main()
      {
      int size = 4;
      int halfHeight = 2 * size;
      for (int i = 0; i < halfHeight; ++i)
      {
      for (int j = 0; j < halfHeight - i; ++j)
      cout

  • @bonifacemusembi9459
    @bonifacemusembi9459 9 ปีที่แล้ว

    how can i form this pattern
    *
    * *
    * * * * *
    *
    *
    *
    please help

  • @speakingwordsindia5631
    @speakingwordsindia5631 8 ปีที่แล้ว

    not a correct code i think. The program is not running correctly
    plz help

  • @martialolipiano9803
    @martialolipiano9803 4 ปีที่แล้ว

    please can you do it in Visual Logic?

    • @thespicyspicey
      @thespicyspicey 4 ปีที่แล้ว

      Check out this video, you'll understand
      th-cam.com/video/_XNSg6Az3JE/w-d-xo.html

  • @olsonjames2614
    @olsonjames2614 4 ปีที่แล้ว

    how to get the out of 9 stars shape by using c++ program

  • @bipros7
    @bipros7 9 ปีที่แล้ว +1

    Sir,after coding the above statements when i run this program,stars of upper half of the triangle from row 1 to row 5....but the lower half of the triangle is not executed...I'm using turbo C++ compiler fr windows7...why is this happening?

    • @vijayKumar-pf8ol
      @vijayKumar-pf8ol 8 ปีที่แล้ว

      beta ye work ni kregaa

    • @Kris-ui1wv
      @Kris-ui1wv 6 ปีที่แล้ว +1

      #include
      int main()
      {
      int n, m, k, i= 1;
      printf("Vendosni numrat e rreshtave
      ");//n-nr rreshtash
      scanf("%d", &n);
      i = n - 1;//i hapesira
      for (k = 1; k

    • @vignesh8507
      @vignesh8507 5 ปีที่แล้ว

      @@Kris-ui1wv appreciate you

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @shristisinha7264
    @shristisinha7264 5 ปีที่แล้ว

    how we will write the code for N pattern

  • @lakhdeepsingh5883
    @lakhdeepsingh5883 7 ปีที่แล้ว

    sir pls tell, which platform you use to write codes,
    i use turbo c

  • @piyushsingh2719
    @piyushsingh2719 4 ปีที่แล้ว

    thank
    you
    sir

  • @krishnadevanp3820
    @krishnadevanp3820 6 ปีที่แล้ว

    Which compiler is this??...can you help.Me to install that on windows10

  • @ThePheonix123
    @ThePheonix123 8 ปีที่แล้ว

    The code source link is not working for me, can u pls post a working link?

    • @Ghandimw2
      @Ghandimw2 8 ปีที่แล้ว

      +ThePheonix123 This is the same code but uses an input from the user in order to make the triangle. Use the online c++ compiler c++ shell and it'll run.
      #include
      using namespace std;
      int main()
      {
      int n;
      cout > n;
      for (int row=1; row=1; col--){
      cout

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @seeknithyashri6591
    @seeknithyashri6591 7 ปีที่แล้ว +1

    sir why u r naming the lower half as 4 3 2 1...can we name it as 1 2 3 4....

    • @baljotsingh4013
      @baljotsingh4013 3 ปีที่แล้ว

      Because the loop is working in reverse, so the rows will be 4 3 2 1, 1 2 3 4 is when you're iterating a normal loop

  • @zoufisha6376
    @zoufisha6376 8 ปีที่แล้ว

    awesome and fully usefull

  • @andargachewmekonnen7164
    @andargachewmekonnen7164 5 ปีที่แล้ว

    It is awesome

  • @benjidabull
    @benjidabull 6 ปีที่แล้ว

    THANK YOU SO MUCH

  • @ashishmane1343
    @ashishmane1343 9 ปีที่แล้ว

    "9 7 C:\Users\Ashish\Desktop\porgrams\pattern print 2.cpp [Error] 'colstar' was not declared in this scope"
    what does that mean pleas tell me the solution on this error........

    • @wethecomputerguys9903
      @wethecomputerguys9903  9 ปีที่แล้ว

      Ashish Mane Post your source code.

    • @ashishmane1343
      @ashishmane1343 9 ปีที่แล้ว +1

      #include
      main(){
      int totalrows=5;
      int row,colspace,rowstar;
      for(row=1;row=1;colspace--){
      printf(" ");
      }
      for(colstar=1;colstar=1;row--){
      for(colspace=1;colspace

    • @bipros7
      @bipros7 9 ปีที่แล้ว +1

      Ashish Mane while declaring you mentioned rowstar instead of colstar,thatswhy this error is coming...

    • @Junaidkhan-ti8qd
      @Junaidkhan-ti8qd 8 ปีที่แล้ว

      +Biprodip Sanyashi how this error can be removed plz tell me
      as they say "undefine colstar"in the upper written program

    • @skylar6268
      @skylar6268 8 ปีที่แล้ว

      +Junaid khan error can be removed by changing the name of the variable rowstar into colstar (or) instead of colstar use rowstar itself !

  • @Pachojuanck
    @Pachojuanck 6 ปีที่แล้ว +1

    Ojala hubiera gente que explicara como tu, pero en español :/

  • @BilalRajputKeepcalm
    @BilalRajputKeepcalm 9 ปีที่แล้ว +1

    Great work ..

  • @priyachaudhary1210
    @priyachaudhary1210 6 ปีที่แล้ว

    If(j>=5-i&&j

  • @justinkujur4618
    @justinkujur4618 4 ปีที่แล้ว

    How can i solve this program using a single loop

    • @yuvrajadkar
      @yuvrajadkar 2 ปีที่แล้ว +1

      Shortest and Smart code for diamond pattern in just 2 FOR loops..
      #include
      #include
      #include
      void main()
      {
      int n,row,col,flag=0;
      printf("Enter Number");
      scanf("%d",&n);
      for(row=1; row>=1; row++)
      {
      for(col=1; col=row)
      printf("*");
      else
      printf(" ");
      }
      printf("
      ");
      if(row==n)
      flag=1;
      if(flag==1)
      row = row-2;
      }
      }

  • @shitizgupta3557
    @shitizgupta3557 9 ปีที่แล้ว

    can you plz tell me how to print this
    &&&&&&&
    &&&&&
    &&&
    &

  • @aiazasheikh8224
    @aiazasheikh8224 5 ปีที่แล้ว

    Kindly provide this
    using do while loop

  • @shaleen9434
    @shaleen9434 7 ปีที่แล้ว +3

    sir please make a video on
    i
    in
    Ind
    Indi
    india

    • @SUNNYPATILkolhapurkar
      @SUNNYPATILkolhapurkar 6 ปีที่แล้ว +1

      char word[ ]={'i','n','d','i','a'};
      for(int i=0;i

    • @pratyushsrivastava4476
      @pratyushsrivastava4476 5 ปีที่แล้ว

      Printf(" - %5.*",(arrayname), (width)) ; ... Look for it in you book

  • @Abdu_401
    @Abdu_401 6 ปีที่แล้ว

    Thanks

  • @centinelasdelmagisteriomao6520
    @centinelasdelmagisteriomao6520 6 ปีที่แล้ว

    I need to make 64 combinations wiht + and - heelp me please in this

  • @sachinkumar5879
    @sachinkumar5879 10 ปีที่แล้ว

    THANKSSSSSSSSSS SIRRRRRRRRRR

  • @profstat1970
    @profstat1970 9 ปีที่แล้ว

    guys pls tell me how to find this output without using any spaces
    *
    **
    *
    **
    *

    • @tryingtocorrect
      @tryingtocorrect 8 ปีที่แล้ว

      +Prof Stat hmm, how can that be done without spaces becouse it clearly ahs spaces..

    • @jasluvdeepsingh8491
      @jasluvdeepsingh8491 8 ปีที่แล้ว

      The number of * printed is same as the row we are in. Row 1 has 1 * and 2 has 2 *.
      No need for spaces. Just write the loop for star with
      for(row=1; row

  • @Usgshshs
    @Usgshshs 9 ปีที่แล้ว

    kardeşim teşekkür ederim

  • @mohammedk.k6472
    @mohammedk.k6472 7 ปีที่แล้ว

    thanks Sir

  • @diamondabbasi284
    @diamondabbasi284 7 ปีที่แล้ว

    thank u sir

  • @munazamalik7427
    @munazamalik7427 6 ปีที่แล้ว

    Isi ko C++ me kese bnaty hn plz tell me 😑

  • @nagapurisaivishal1667
    @nagapurisaivishal1667 7 ปีที่แล้ว

    Please i need Code make video for below pattern
    1 1
    33 33
    555555
    33 33
    1 1

  • @vivekkumarsoni3860
    @vivekkumarsoni3860 9 ปีที่แล้ว

    Nyc...

  • @suprajaprabakaran2159
    @suprajaprabakaran2159 7 ปีที่แล้ว

    I need a mentor to write a c programming... I wanna know about the c programming from beginning... can u please guide me...can u give me ur email Id pls...

  • @jhay-araguilar5462
    @jhay-araguilar5462 10 ปีที่แล้ว

    if n = 4
    4 3 2 1
    3 2 1
    2 1
    1
    Can you help me please?

    • @wethecomputerguys9903
      @wethecomputerguys9903  10 ปีที่แล้ว

      Hope this would be helpful : wethecomputerguys.com/2014/08/23/pattern-printing-23/

    • @jhay-araguilar5462
      @jhay-araguilar5462 10 ปีที่แล้ว

      //print spaces
      for(j=0;j0;j-)
      printf(“%d “,j);
      This part is incorrect and I try to rearrange this but it's still no good.

    • @wethecomputerguys9903
      @wethecomputerguys9903  10 ปีที่แล้ว

      Jhay-ar Aguilar We are extremely sorry for our mistake ... Thanx for pointing it out.. I have updated the code .. Now it works fine..

    • @jhay-araguilar5462
      @jhay-araguilar5462 10 ปีที่แล้ว

      We The Computer Guys It works. Thanks. :)

  • @juanrodriguezluis4811
    @juanrodriguezluis4811 4 ปีที่แล้ว

    good idea... sad that his accent is too strong... i can not understand, what he says.

  • @arjaypaglinawan1996
    @arjaypaglinawan1996 10 ปีที่แล้ว

    if n = 4
    4 3 2 1
    4 3 2
    4 3
    4
    need help :(

  • @serdarkarakas996
    @serdarkarakas996 7 ปีที่แล้ว +1

    lan bu ne biçim ingilizce 12 dakika 43 saniye boyunca işkence ettin be bilader.
    thanks for video, great india namaste

  • @aruna4760
    @aruna4760 7 ปีที่แล้ว

    Sir please explain the below pattern
    1
    1 * 2
    1 * 2 * 3
    1 * 2 * 3 * 4
    1 * 2 * 3 * 4 * 5

  • @vigneshseralathan9884
    @vigneshseralathan9884 8 ปีที่แล้ว

    bro print this pattern.
    P M
    R A
    O R
    G
    O R
    R A
    P M
    Please help me out with this
    in C nd JAVA

    • @thespicyspicey
      @thespicyspicey 4 ปีที่แล้ว

      Hello, it's been 4 years.. hope you had cleared this problem. If you still haven't, reply here, I'll send you the code and explain it to you.

  • @shreyapaul358
    @shreyapaul358 5 ปีที่แล้ว

    With my like u complete 1k like🙂

  • @moixcodez1585
    @moixcodez1585 6 ปีที่แล้ว +1

    omg your
    english ankcent.........

  • @ashissahoo4158
    @ashissahoo4158 9 ปีที่แล้ว

    how to draw pattern
    sssss
    s s
    s s
    s s
    sssss

  • @xsquall19x
    @xsquall19x 9 ปีที่แล้ว

    VASH HAMANYAK

  • @sawakokuronuma8689
    @sawakokuronuma8689 6 ปีที่แล้ว

    bhai ya urdu ma ya hindi ma hi bol lety..

  • @atreyeesardar6100
    @atreyeesardar6100 8 ปีที่แล้ว

    *******
    *****
    ***
    *
    ***
    *****
    *******

  • @DeepakYadav-gz9ei
    @DeepakYadav-gz9ei 5 ปีที่แล้ว

    Quality bahoot kharab hai

  • @venkat2830
    @venkat2830 9 ปีที่แล้ว

    c is difficult aaaaaaaaaaaaaa

  • @TheZekf
    @TheZekf 7 ปีที่แล้ว +8

    omg your accent dude :(

  • @dubbingertugalseries5155
    @dubbingertugalseries5155 4 ปีที่แล้ว

    Q English ko chod rha hai.Hindi ma baat ker kuch samj v aa jaye..ya English seekh k bol.

  • @monukumar5618
    @monukumar5618 5 ปีที่แล้ว

    Need to improve

  • @soustavnandy3043
    @soustavnandy3043 3 ปีที่แล้ว

    Bad

  • @dilhanidesilva548
    @dilhanidesilva548 9 ปีที่แล้ว +2

    thank you sir

  • @muhammadsheharyar4105
    @muhammadsheharyar4105 7 ปีที่แล้ว +1

    *
    * *
    * *
    * *
    * *
    *******