



![
[> Diamond c program
* main() {
int i,j,rows,num=25,k,l,m;
printf("enter the no of rows");
scanf("%d",&rows); for(i=0;i=0;k--)
printf(" "); for(j=0;j<=2i;j++)
printf("*"); printf("\n"); }
for(l=i;l=0;k--) printf(" ");
for(m=0;m<(rows/2-1);m++)
printf("*"); printf("\n"); i--; } }
code by vinod pragati clg - List
item][1]
][1]
[1]: http://

Diamond c program
main() {
int i,j,rows,num=25,k,l,m;
printf("enter the no of rows");
scanf("%d",&rows); for(i=0;i<rows/2;i++)
{
for(k=num-i;k.=0;k--)
printf(" "); for(j=0;j<=2i;j++)
printf("*"); printf("\n"); }
for(l=i;l<rows;l++) { for(k=num-(i-2);k>=0;k--) printf(" ");
for(m=0;m<(rows/2-1);m++)
printf("*"); printf("\n"); i--; } }
code by vinod pragati clg - List
item][1]

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,a[20][30],n;
printf("enter the no of rows");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<i;j++)
{
if(i<2)
{a[i][j]=1;
printf("%d\t",a[i][j]);
}
else
{
a[i][j]=a[i-1][j-1]+a[i-1][j]
printf("%d\t",a[i][j]);
}
}
printf("\n");
}
getch();
}

printf("using only one dimensional array") ;
int n1 = (rows * (rows+1))/2 ;
int b[n1];
int p = 1;
for(int i = 0 , j = 0 ; i < n ; ++i , ++j)
{
int k = i+j ;
b[j] = 1 ;
//printf("%d",b[j]);
if(j < k )
{
++j ;
while(j < k)
{
b[j] = b[p] + b[p + 1] ;
//printf("\t%d",b[j]);
++j ;
++p;
}
b[j] = 1 ;
//printf("\t%d",b[j]);
if( i > 1)
++p;
}
//printf("\n");
}

Pascals triangle using 1D array
int n1 = (rows * (rows+1))/2 ;
int b[n1];
int p = 1;
for(int i = 0 , j = 0 ; i < n ; ++i , ++j)
{
int k = i+j ;
b[j] = 1 ;
//printf("%d",b[j]);
if(j < k )
{
++j ;
while(j < k)
{
b[j] = b[p] + b[p + 1] ;
//printf("\t%d",b[j]);
++j ;
++p;
}
b[j] = 1 ;
//printf("\t%d"b[j]);
if( i > 1)
++p;
}
//printf("\n");
}

pls can any one give me code...to make pascal triangle with recursion
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.