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
What language is lisp written in?
What is New modifiers?
What is the importance of c in your views?
What is the use of a conditional inclusion statement in C?
Where in memory are my variables stored?
What is meant by int main ()?
What is header file in c?
what is bit rate & baud rate? plz give wave forms
Tell me when would you use a pointer to a function?
Do character constants represent numerical values?
Why we use break in c?
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
What is difference between static and global variable in c?
What is structure packing in c?
Why functions are used in c?