Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


1
1 1
1 2 1
1 3 3 1
1 4 6 4 1



1 1 1 1 2 1 ..

Answer / guest

#include<conio.h>
#include<stdio.h>
void main()
{
int a[10],b[10];
int c=1,n=5;
a[0]=0;a[1]=1;a[2]=0;
b[0]=0;
printf("Enter no. of rows to print ");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
for(int j=n-2;j<0;j++)
printf(" ");
c++;
for(int k=0;k<c;k++)
{
b[k+1]=a[k]+a[k+1];
}
b[c]=0;
for(int k=1;k<=i+1;k++)
{
printf("%d ",a[k]);
}
printf("\n");
for(int k=0;k<i+3;k++)
a[k]=b[k];
}
getch();
}


Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

how to swap two integers 1 and 32767 without using third variable

11 Answers   Microsoft, TCS,


main() { charx; while (x=0;x<=255;x++) printf("\nAscii value %d Character %c,x,x); }

2 Answers  


What is a global variable in c?

0 Answers  


What is spaghetti programming?

0 Answers  


Explain Doubly Linked Lists?

3 Answers  


Write a c program to sort six numbers and find the largest one by using the ladder of if-else? plz do help me

2 Answers  


write a program of palindrome(madam=madam) using pointer?

5 Answers   L&T,


differnce between do and do while

3 Answers   DOEACC,


Why c is called object oriented language?

0 Answers  


Where are some collections of useful code fragments and examples?

0 Answers   Celstream,


What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


what is the difference between call by value and call by reference?

5 Answers   Genpact, Global Logic, Infosys,


Categories