Showing posts with label Lab Exams. Show all posts
Showing posts with label Lab Exams. Show all posts

Tuesday, 8 November 2011

Write a program to print Pascal triangle

Algorithm:

 Step1:         start

Step2:         initialize binom =1, f=0

Step3:         check the condition f<p

Step4:         for r=40-3*f;r>0; --r

Step5:         print" "

Step6:         for x=0; x<f; ++x

Step7:         if x == 0 or f==0

          Binom = 1


Step8:         else

          Binom=(bimom*(f-x+1)/x


          Printf binom


Step9:         stop

 

Program: