- 2

How i created upside down pyramid in c# by using while loop?

Please tell me quickly!

31st Mar 2022, 6:08 PM
Sheza Rao
Sheza Rao - avatar
6 Respuestas
+ 2
Your try?
31st Mar 2022, 6:12 PM
Adil
Adil - avatar
+ 1
So show your try, only then others will help you.
31st Mar 2022, 6:16 PM
Adil
Adil - avatar
+ 1
Sheza Rao Pls share the code link by saving in playground.. There are typo error by auto capitalization. This may help you, to share links https://www.sololearn.com/post/75089/?ref=app
31st Mar 2022, 7:25 PM
Jayakrishna 🇮🇳
+ 1
Sheza Rao The results you showed are not possible by these codes. These are the results of your code. Your question looks like an assignment. Hint: Use for loops. https://code.sololearn.com/ci48v5tyJO67/?ref=app https://code.sololearn.com/cRYqj53J64J1/?ref=app
31st Mar 2022, 8:33 PM
Adil
Adil - avatar
0
I created pyramid like this! Int a = 5; Int c = 1; While (1<=a) { Int b = a; While (1<=b) { Console.Write(" "); B--; } While (5>=c) { Int d = c; While (5>=d) } Console.Write("*"); C++; } Console.WriteLine() A--; D++; Result: * * * * * * * * * * * * * * * I tried the same process with some changes to create upsidedown pyramid! Like this! Int a = 1; Int c = 5; While (5>=a) { Int b = a; While (5>=b) { Console.Write(" "); B++; } While (1<=c) { Int d = c; While (1<=d) } Console.Write("*"); C--; } Console.WriteLine() A++; D--; But the result is different! * * * * * * * * * * * * * * *
31st Mar 2022, 6:38 PM
Sheza Rao
Sheza Rao - avatar
- 2
Yeah i tried so many times!
31st Mar 2022, 6:13 PM
Sheza Rao
Sheza Rao - avatar