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
Explain what are the __date__ and __time__ preprocessor commands?
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
What is the auto keyword good for?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
Which is better between malloc and calloc?
Why c is procedure oriented?
what are the facialities provided by you after the selection of the student.
What is c mainly used for?
What is the use of parallelize in spark?
Differentiate between full, complete & perfect binary trees.
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
Differentiate between declaring a variable and defining a variable?
Which built-in library function can be used to match a patter from the string?
Explain high-order and low-order bytes.
show how link list can be used to repersent the following polynomial i) 5x+2