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
What are the benefits of c language?
What are actual arguments?
Is c call by value?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Can you please explain the difference between strcpy() and memcpy() function?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What is fflush() function?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
When is a “switch” statement preferable over an “if” statement?
What is c programing language?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What does the c preprocessor do?
What is the auto keyword good for?
show how link list can be used to repersent the following polynomial i) 5x+2
Are pointers integers in c?