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 is array within structure?
How can I get back to the interactive keyboard if stdin is redirected?
Explain main function in c?
What is the use of header?
How can a number be converted to a string?
What does 2n 4c mean?
simple program of graphics and their output display
What is output redirection?
formula to convert 2500mmh2o into m3/hr
What is the equivalent code of the following statement in WHILE LOOP format?
How will you write a code for accessing the length of an array without assigning it to another variable?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
Can we replace the struct function in tree syntax with a union?
What is return in c programming?
What is the difference between #include