C Practical and Assignment Programs-Printing Pascals Triangle

Поделиться
HTML-код
  • Опубликовано: 16 сен 2024
  • C Practical and Assignment Programs-Printing Pascals Triangle
    It is the most common question asked in aptitude and interview.
    In this video we are going to write a program to print a Pascal's Triangle. We are going to use nested for loops ie one loop inside another.The full description of question is provided below. Now this program is written in C programming language but will work in C++.Fell free to provide you suggestion.
    Q. To print various patterns using loop constructs like:
    1
    1 1
    1 2 1
    1 3 3 1
    1 4 6 4 1
    Source Code: wethecomputergu...
    Facebook Page; / wethecomputerguys
    Pattern Printing 6:
    • C Practical and Assign...
    Playlist: • C Practical and Assign...
    Blog: wethecomputergu...
    • C Practical and Assign...
    We The Computer Guys
    Shreyas Zagade
    Aakash Thakur
    Ananya Jain

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

  • @abhishekmedha1098
    @abhishekmedha1098 8 лет назад +3

    very good logic. i was not at all understanding this before , but after watching the video it is quite clear. Thanks a lot
    .One point-> in the last loop you told the "colchar" should start with 0,but i don't think so . We can start it from 1 as well . The changes required will be in the first loop "row" should start with 1and the condition over there would be "row

  • @DanielAngali
    @DanielAngali 7 лет назад +7

    Thank you so much, brother, I was searching for this and I got it.

  • @SmartProgramming
    @SmartProgramming 6 лет назад +3

    nice one sir, explanation is simply great 👍👍

  • @sondidu
    @sondidu 2 года назад

    thanks a lot man, other videos just show you how to do it but never really tell us why is that, in this video you just told us why and now I understand, thanks so much

  • @samanthammiranda8480
    @samanthammiranda8480 3 года назад +1

    I was searching for this THANK YOU!

  • @oxxxca_dot_exe6657
    @oxxxca_dot_exe6657 10 лет назад +3

    Thank you!!!!!!
    I was getting insane thinking how to do this for my homework
    u have a nu suscriber :DD

  • @nikhilgoyal8340
    @nikhilgoyal8340 8 лет назад

    A very good explanation of how to print pascal triangle without using factorial.

  • @MahaLakshmi-sk1fk
    @MahaLakshmi-sk1fk 3 года назад

    thank you sir .I can understand the logic clearly only from your video.

  • @anilkumarkarri3978
    @anilkumarkarri3978 2 года назад +1

    Well said sir....

  • @zombiestrange6475
    @zombiestrange6475 3 года назад

    I was looking for this, Thank you for the explanation!!

  • @sourinroy3676
    @sourinroy3676 5 лет назад +1

    Respected Sir, the logic you used is nice, but for me I think I will define a function name Permutation and define there how a Permutation works and than I can use that function in the main loop as row no.C flag. flag goes from 0 to no.of charactera

  • @banshkumar3498
    @banshkumar3498 3 года назад

    Mauj kardi 😁
    Thank you 👍

  • @moranifarhad
    @moranifarhad 9 лет назад +2

    Feabules goood... its easy and .. its helpfull for me... thnx...

  • @aakashsharma1009
    @aakashsharma1009 9 лет назад

    Nicely explained and very good logic. Thanks

  • @jagginadivya3680
    @jagginadivya3680 5 лет назад

    nyc teaching i started thinking on my own bcz u

  • @siddardha756
    @siddardha756 5 лет назад +1

    Nice sir...but i have a doubt in the following below step is.....
    For(colspaces=no of rows-row;colspace>=1;colspace--);
    You told like this sir....
    But in this program we started row with 0,so we use
    For(colspaces=no of rows-row-1;colspace>=1;colspace--);
    I guess it is correct sir...so tell me the correct answer

  • @soanpari6048
    @soanpari6048 9 лет назад +2

    best and easy explanation.......!!!

  • @umargul5644
    @umargul5644 2 года назад

    Well done 👏 ✔ 👍 👌 😀 🙌 👏 ✔

  • @amlansengupta7274
    @amlansengupta7274 7 лет назад +2

    After the den++ in the next line within the loop itself printf(" ");

  • @hardikkothari1312
    @hardikkothari1312 8 лет назад +1

    Hiiiii, I m Hardik,
    I want to print a program like
    if i print 122
    output =121
    prepelindrome number of the number which we have type....
    like 145
    output=141.....
    i think u understand my question with the example perfectly.....
    plzz give me answer as soon as possible.....
    Thank you.

  • @akshaythakur262
    @akshaythakur262 10 лет назад

    Thnkuuu Brooo....Help Me In SPA....Keep posting such VDO....

  • @sarathchandrakuchi2672
    @sarathchandrakuchi2672 4 года назад

    Very nice video

  • @rayhan8701
    @rayhan8701 7 лет назад

    hi bro this video made my day
    I really satisfied with it

  • @naveenvysyaraju1343
    @naveenvysyaraju1343 9 лет назад +2

    please uplaod linked lists and pallindroem string and number

  • @rzverlabuguen6826
    @rzverlabuguen6826 10 лет назад +2

    thank you :)

  • @wethecomputerguys9903
    @wethecomputerguys9903  10 лет назад +1

    anushka chandel On the last line should there be 5 & instead of 6 &?

  • @satyanshshukla9535
    @satyanshshukla9535 7 лет назад

    really helpful....thanks...😃

  • @SunburnTomato
    @SunburnTomato 4 года назад

    Thankyou bhaiya..👍👍

  • @lenocr7
    @lenocr7 8 лет назад +1

    graciaaaas!!

  • @sharifabib3266
    @sharifabib3266 8 лет назад +1

    sir I am learning c for TCS once plz tel me how to prepare nd present nicely

  • @anirbanghosh5555
    @anirbanghosh5555 2 года назад

    amazing

  • @vaibhavnigam422
    @vaibhavnigam422 5 лет назад

    Please explain the program in diamond comes in the middle portion of the rows

  • @shreykotharib2
    @shreykotharib2 8 лет назад +2

    sir there is problem in this program for more then 5 rows because we ignored carry logic here which takes part after 5th row

  • @harikrishna3298
    @harikrishna3298 8 лет назад +2

    sir I want c complete tutorial please. do it sir

  • @pavanbetageri140
    @pavanbetageri140 8 лет назад

    nice information..

  • @anshreddy1162
    @anshreddy1162 3 года назад

    Can you please help with this program in C .?
    Compute square root with time complexity o(log2n)

  • @tapanjeetroy8266
    @tapanjeetroy8266 6 лет назад

    thank you sir

  • @karthikgupta4713
    @karthikgupta4713 8 лет назад

    what is the ide you used for compiling the code

  • @MrEvilyogurt
    @MrEvilyogurt 6 лет назад

    I’m new to programming but how would you do this for random letters on a keyboard . I want to make a simple triangle with 3 different letters or numbers . E.g = A,S,D

  • @meenaramesh9401
    @meenaramesh9401 6 лет назад

    here we are adding 1 and 0 at the both ends and 0 next 1 in the middle

  • @kritisingh3095
    @kritisingh3095 5 лет назад

    After 6 programs,,,guys to programmers✌✌

  • @Gangmu1920
    @Gangmu1920 6 лет назад

    Shouldn’t the colspace definition be colspace= noofrows-rows-1

  • @shreyaboinpally5255
    @shreyaboinpally5255 3 года назад

    how the space between the numbers is coded,can anyone please explain

  • @abhishekmedha1098
    @abhishekmedha1098 8 лет назад

    sorry bro,my suggestion was wrong.
    What you had explained is right. it should start with 0 only not with 1.
    got the logic.

  • @wethecomputerguys9903
    @wethecomputerguys9903  10 лет назад +1

    anushka chandel Here is the link to the pattern wethecomputerguys.com/2014/09/18/pattern-printing-31/

  • @somasen5207
    @somasen5207 8 лет назад

    please explain pascal's traingle once in an easy methode.

  • @mohamedhijasjunaideen6719
    @mohamedhijasjunaideen6719 6 лет назад

    are you using a global variable?

  • @parthtailor3823
    @parthtailor3823 6 лет назад

    will you plz do this program using 2d array

  • @sukhmanjotkaur3698
    @sukhmanjotkaur3698 2 года назад

    👍👍

  • @harmankibue2497
    @harmankibue2497 7 лет назад +1

    which compiler is being used here?

  • @RahulPandey-ib3ew
    @RahulPandey-ib3ew 6 лет назад

    sir, in 11 row for colspace the condition should be colspace > 1 not colsppace>=1

  • @codewalla
    @codewalla 6 лет назад

    Hello sir, how to put inplace of 2 ,3,4 is 0 and 1 is as it is.

  • @sarasrujan5212
    @sarasrujan5212 9 лет назад

    is there is any other essay way for programing pascal triangle because it is very difficult

    • @wethecomputerguys9903
      @wethecomputerguys9903  9 лет назад

      sara srujan This is slightly easier ruclips.net/video/q9XRmwxVjTw/видео.html

  • @premvikas62
    @premvikas62 9 лет назад

    how are the spaces occuring between the numbers even without giving a space after printchar declaration

    • @wethecomputerguys9903
      @wethecomputerguys9903  9 лет назад

      Check Source Code wethecomputerguys.com/2014/03/31/c-practical-and-assignment-programs-printing-pascals-triangle/ line number 13 there is space

  • @ravikishore7204
    @ravikishore7204 8 лет назад

    how to print sum of unique numbers in an array by using c programming language?

  • @shalinigupta7997
    @shalinigupta7997 9 лет назад

    hi guys, wanted to ask one thing.
    101001000...
    how will we develop a pattern in which no. of zeros succeeding one is equal to no. of ones
    e.g two zeros after second one and so on..
    can you code it in V.B 6.0 too?

  • @SaifAli-ex9uc
    @SaifAli-ex9uc 8 лет назад +1

    output is not like a triangle
    how to add spaces between nos

    • @abhishekmedha1098
      @abhishekmedha1098 8 лет назад +1

      just add a space after the %d. In the above video line no 19.

  • @TheCuriousHacker
    @TheCuriousHacker 8 лет назад

    I can't understand c-programming how to understand it what the methods to learn it....!. how should I write a program easily

  • @rajatarora5828
    @rajatarora5828 10 лет назад

    How could you do this using functions where one functions prints out the triangle, another one calculates the value of each number on any given line using ncr =n!/r!(n − r)!,

  • @sunilthapa9741
    @sunilthapa9741 8 лет назад

    how to get prime factors of a number plz explain me

  • @tejaswiniravva795
    @tejaswiniravva795 4 года назад

    👏👌👌👌

  • @arjunnatukula7128
    @arjunnatukula7128 5 лет назад

    Not loading your source code link to download

  • @JasmeetKaur-zm5hq
    @JasmeetKaur-zm5hq 7 лет назад

    I am not able to understand the dry run of a program

  • @NehaKumari-yf5ld
    @NehaKumari-yf5ld 7 лет назад

    how to print this pattern in c

  • @nisargshah4859
    @nisargshah4859 6 лет назад

    why you have taken colchar as 0

  • @ramgadodiya2818
    @ramgadodiya2818 7 лет назад

    it is showing segmentation fault (core damped)

  • @ajiths1689
    @ajiths1689 6 лет назад +1

    Done dana done

  • @rahulshaw5596
    @rahulshaw5596 4 года назад

    Show the dry run bro

  • @tejaspatkar2184
    @tejaspatkar2184 9 лет назад

    A
    ABA
    ABCBA
    can u send me a link to this pattern

    • @wethecomputerguys9903
      @wethecomputerguys9903  9 лет назад

      tejas patkar wethecomputerguys.com/2014/09/23/pattern-printing-33/ refer this link instead of 1 print A, 2 print B , etc

  • @marcelinojusto2256
    @marcelinojusto2256 8 лет назад

    guys can you help me with this problem ?
    Write a program to create a multiplication table for all combinations of two numbers from 1 to 8.(using nested while loop statement) notes diagonal part of the table must show the letters A-H not the product.
    exact output :
    1 2 3 4 5 6 7 8
    1 A 2 3 4 5 6 7 8
    2 2 B 6 8 10 12 14 16
    3 3 6 C 12 15 18 21 24
    4 4 8 12 D 20 24 28 32
    5 5 10 15 20 E 30 35 40
    6 6 12 18 24 30 F 42 48
    7 7 14 21 28 35 42 G 56
    8 8 16 24 32 40 48 56 H

  • @wethecomputerguys9903
    @wethecomputerguys9903  10 лет назад +1

    arjay paglinawan Hope this would be helpful... wethecomputerguys.com/2014/08/15/pattern-printing-20/

    • @arjaypaglinawan1996
      @arjaypaglinawan1996 10 лет назад

      thank you very much :)

    • @sagarkalsekar8348
      @sagarkalsekar8348 10 лет назад

      hey can you please make a video for linklist program ........i m nt gettting problem to understding this progam

  • @akshaykasar93
    @akshaykasar93 10 лет назад

    plz chage the language...display the programs in hindi ...n plz follow the step one by one that we shud understable..dis is kindly request to u..

  • @morningstar2728
    @morningstar2728 6 лет назад

    Yes i m a good observer! 😂

  • @atashmohire884
    @atashmohire884 6 лет назад

    why are using binomial when we can simply usse easier method....

  • @nageshmarshivane8059
    @nageshmarshivane8059 8 лет назад

    i dint get the logic of writing the program

  • @bandnakoushal7485
    @bandnakoushal7485 10 лет назад

    I am facing problem in 2nd row where 2/1*1/2 logic is in the program i know how these two come but i dnt get from which statement both of them get multiplied and we get result as 1 help me out from the problem thanks

    • @wethecomputerguys9903
      @wethecomputerguys9903  10 лет назад

      Bandna Koushal The step on multiplication and division are separately done on 17th and 18th line of source code. Please refer this link for code wethecomputerguys.com/2014/03/31/c-practical-and-assignment-programs-printing-pascals-triangle/ .

    • @bandnakoushal7485
      @bandnakoushal7485 10 лет назад

      We The Computer Guys thanks

  • @vivekkumarsingh4062
    @vivekkumarsingh4062 6 лет назад

    Not got it

  • @sayleedhindale8585
    @sayleedhindale8585 7 лет назад

    Can plz give me the code of this pattern
    1
    3 5
    7 9 11

  • @brightcareer1560
    @brightcareer1560 7 лет назад +1

    bad logic

  • @Sahilchaudhary1910
    @Sahilchaudhary1910 6 лет назад

    Th way u speak..-repeating words again and again as if u yourself are confused .
    This method seems so confusing + your voice = "???" ...

  • @johnnybatafljeska6368
    @johnnybatafljeska6368 7 лет назад

    For me, this looks easy, but it really isnt

  • @pratikshya2010
    @pratikshya2010 10 лет назад

    ye kya chuap h

  • @nidhimaniyar8783
    @nidhimaniyar8783 3 года назад

    .

  • @TheZekf
    @TheZekf 7 лет назад +1

    You are talking too much

  • @wethecomputerguys9903
    @wethecomputerguys9903  10 лет назад

    ***** Here is the link: wethecomputerguys.com/2014/06/30/pattern-printing-13/
    It explains the logic(look at the image) and the code.

  • @jasimchouhan4784
    @jasimchouhan4784 7 лет назад +9

    poor teaching, you are confused sir.

  • @AYadavJi-108
    @AYadavJi-108 6 лет назад +1

    do not teach like this

  • @subhammishra3433
    @subhammishra3433 6 лет назад

    very bad representation

  • @lokeshbandi7431
    @lokeshbandi7431 6 лет назад

    Not...in a proper way

  • @shivrajsingh-qv3tl
    @shivrajsingh-qv3tl 5 лет назад

    Confuse kar diya bhaut chola pagal