Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

Hii... i really need help... pls help...

so my question is:
how to write a c program to print pascal triangle using for loop ?
its output should be like this
2 1
3 2 1
4 3 2 1
5 4 3 2 1
pls guyzz i need to submit it tmrww...
thnx in advance
check my solution it is very brief. and it is easily understood.


long fact(int);
int main()
 int line,i,j;
    printf("Enter the no. of lines: ");
    printf(" ");
    printf("%ld ",fact(i)/(fact(j)*fact(i-j)));
    return 0;}
long fact(int num)
    long f=1;
       int i=1;
         f=f*i;         i++;  } 
 return f;

if this helped u...
pls let me know by marking it best! ;) :)
2 4 2
but i hv one confusion , i need this only with for loop nd u hv usd while loop nd also wat abt dis fact...???
i'm just an amateur...
i just tried as i saw your question and I've got it!!
and i'll see if i could help u the way you want!!
thnk u so mch...!!!!
pls...... did u get the answer..???
what have you done? the pattern is not what you are printing.....

This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
#include <stdio.h>
  int row, H , j ;
      printf("Height of triangle:  "); 
      scanf("%d", &H);
      for (row=1; row <= H ; row++ )
             for (j = row; j >= 1 ; j--)      // print integers, starting from row number up to 1
                   printf("%d  ", j);

1 5 1
This is the exact and perfect solution
If you like the solution, rate the answer as brainliest please.
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts