- 2
How i created upside down pyramid in c# by using while loop?
Please tell me quickly!
7 ответов
+ 2
Your try?
+ 1
So show your try, only then others will help you.
+ 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
+ 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
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!
*
* *
* * *
* * * *
* * * * *
- 2
Yeah i tried so many times!