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

Explain the difference between exit() and _exit() function?

1158


What does typedef struct mean?

1092


What is the -> in c?

994


What is indirection in c?

1056


Do variables need to be initialized?

1026


Write a function that will take in a phone number and output all possible alphabetical combinations

1029


What do you mean by dynamic memory allocation in c? What functions are used?

1148


What is volatile, register definition in C

1086


What are high level languages like C and FORTRAN also known as?

1154


What is a stream?

1120


What is variable in c example?

1044


write a programming in c to find the sum of all elements in an array through function.

2151


Why enum is used in c?

937


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1932


Explain what is a 'locale'?

1065