Answer Posted / tknowledge05
#include<conio.h>
#include<stdio.h>
void main()
{
int a[10],b[10];
int c=1,n=4;
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 ? | 1 Yes | 0 No |
Post New Answer View All Answers
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Difference between pass by reference and pass by value?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
What are structure members?
What is a const pointer?
write a program to rearrange the array such way that all even elements should come first and next come odd
Explain can the sizeof operator be used to tell the size of an array passed to a function?
How can you restore a redirected standard stream?
What does c in a circle mean?
Write program to remove duplicate in an array?
Can a variable be both constant and volatile?
Explain can you assign a different address to an array tag?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
Is c a great language, or what?
a value that does not change during program execution a) variabe b) argument c) parameter d) none