C Practical and Assignment Programs-Printing Pascals Triangle

preview_player
Показать описание
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

Pattern Printing 6:

We The Computer Guys
Shreyas Zagade
Aakash Thakur
Ananya Jain
Рекомендации по теме
Комментарии
Автор

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<=noOfRows".

abhishekmedha
Автор

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

sondidu
Автор

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

DanielAngali
Автор

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

MahaLakshmi-skfk
Автор

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

sourinroy
Автор

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

i think u understand my question with the example
plzz give me answer as soon as
Thank you.

hardikkothari
Автор

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

nikhilgoyal
Автор

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

zombiestrange
Автор

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

siddardha
Автор

nice one sir, explanation is simply great 👍👍

SmartProgramming
Автор

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

oxxxca_dot_exe
Автор

nyc teaching i started thinking on my own bcz u

jagginadivya
Автор

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

sharifabib
Автор

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

RahulPandey-ibew
Автор

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

meenaramesh
Автор

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

abhishekmedha
Автор

Nicely explained and very good logic. Thanks

aakashsharma
Автор

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

shreykotharib
Автор

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

moranifarhad
Автор

what is the ide you used for compiling the code

karthikgupta