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

how to write a cprogram yo get output in the form
*
***
*****
*******
*********
*******
*****
***
*

Answer Posted / c.p.senthil

description for previous answer posted again

n = 5
loop 1: i = 0 to 4
loop 2: i = 5 to 0

Loop variables => i j k j exp k exp
.....*............0 5 spaces, 1 stars (5-0) (2*0)+1
....***...........1 4 spaces, 3 stars (5-1) (2*1)+1
...*****..........2 3 spaces, 5 stars (5-2) (2*2)+1
..*******.........3 2 spaces, 7 stars (5-3) (2*3)+1
.*********........4 1 spaces, 9 stars (5-4) (2*4)+1
***********.......5 0 spaces, 11 stars(5-5) (2*5)+1
.*********........4 1 spaces, 9 stars (5-4) (2*4)+1
..*******.........3 2 spaces, 7 stars (5-3) (2*3)+1
...*****..........2 3 spaces, 5 stars (5-2) (2*2)+1
....***...........1 1 spaces, 3 stars (5-1) (2*1)+1
.....*............0 5 spaces, 1 stars (5-0) (2*0)+1

..........generalising expressions => (n-i) (2*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 what are the __date__ and __time__ preprocessor commands?

1070


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

1470


What is the auto keyword good for?

1063


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

941


Which is better between malloc and calloc?

1118


Why c is procedure oriented?

992


what are the facialities provided by you after the selection of the student.

2172


What is c mainly used for?

994


What is the use of parallelize in spark?

974


Differentiate between full, complete & perfect binary trees.

1051


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1948


Differentiate between declaring a variable and defining a variable?

994


Which built-in library function can be used to match a patter from the string?

1235


Explain high-order and low-order bytes.

1046


show how link list can be used to repersent the following polynomial i) 5x+2

2186