C# DrawPyramid in Microsoft Visual Studio | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

C# DrawPyramid in Microsoft Visual Studio

Why does the same code look different when I run it in Visual Studio than on the online platform? This code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void DrawPyramid(int n) { for (int i=1; i<=n; i++) { for (int j=i; j<=n; j++) { Console.Write(" "); } for (int k=1; k<=2*i-1; k++) { Console.Write("*"+" "); } Console.WriteLine(); } } static void Main(string[] args) { DrawPyramid(5); } } } Outputs this on the Code playground: * * * * * * * * * * * * * * * * * * * * * * * * * And this in the Visual Studio: * * * * * * * * * * * * * * * * * * * * * * * * * Someone could tell me why is this?

24th Jun 2018, 5:34 PM
Virág Horváth
Virág Horváth - avatar
1 Answer
+ 1
Thank you for your anwer! I take it this is only a visual difference, and it won't affect other codes-outputs
25th Jun 2018, 11:23 AM
Virág Horváth
Virág Horváth - avatar