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...

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


Please Help Members By Posting Answers For Below Questions

If the size of int data type is two bytes, what is the range of signed int data type?

1075


can any one provide me the notes of data structure for ignou cs-62 paper

2233


What are pragmas and what are they good for?

1060


What does double pointer mean in c?

1263


how to write optimum code to divide a 50 digit number with a 25 digit number??

3302


What is %lu in c?

1333


What is difference between main and void main?

1292


How can I handle floating-point exceptions gracefully?

1248


What is void pointers in c?

1066


Explain low-order bytes.

1101


How can I trap or ignore keyboard interrupts like control-c?

1118


What is c language & why it is used?

1180


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

1324


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2800


What is a void * in c?

1137