print out put like this form
1 2 3 4 5 6
3 5 7 9 11
8 12 16 20
Answer Posted / sanjay bhosale
int *a,n;
printf("\n Enter the number of elements");
scanf("%d",&n);
a = new int[n];
for(int i=0;i<n;i++)
{
a[i] = i+1;
}
printf("\n : Output : \n");
for(int i=0;i<n;i++)
{
printf("%d\t",a[i]);
}
for(int t = n-1;t>0;t--)
{
printf("\n");
for(int i=0;i<t;i++)
{
printf("%d\t",a[i]+a[i+1]);
a[i] = a[i]+a[i+1];
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
If the size of int data type is two bytes, what is the range of signed int data type?
can any one provide me the notes of data structure for ignou cs-62 paper
What are pragmas and what are they good for?
What does double pointer mean in c?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is %lu in c?
What is difference between main and void main?
How can I handle floating-point exceptions gracefully?
What is void pointers in c?
Explain low-order bytes.
How can I trap or ignore keyboard interrupts like control-c?
What is c language & why it is used?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What is a void * in c?