1

I want to draw a Line chart of the 3n+1 problem but I don't know what to do. Here's my 3n+1 program

using System;
                    
public class Program
{
    public static void Main()
    {
        Console.Write("Enter a number: ");
            int n  = Convert.ToInt32(Console.ReadLine());
            
            
            while (n != 1)
            {
                if (0  == n % 2)
                {
                    n = n / 2;
                    
                    Console.WriteLine(n);
                }
                else
                {
                    n = 3 * n + 1;
                    Console.WriteLine(n);
                    
                }
                
            }
            Console.WriteLine("End of program");
    }
}

Help please :D Thankyou

  • 2
    You mean like ASCII art? Or do you mean use a console app to create eg a PNG of a chart, one that looks nice etc – Caius Jard Aug 20 '21 at 06:37
  • 1
    The console cannot draw graphic images unless using characters as in ASCII Art. For advanced features, take a look at https://github.com/minhhungit/ConsoleTableExt and https://github.com/spectreconsole/spectre.console –  Aug 20 '21 at 06:57
  • Does this answer your question? [How can I draw a diagonal line with Console.SetCursorPosition c#?](https://stackoverflow.com/questions/57546210/) and [How to draw a rectangle in console application?](https://stackoverflow.com/questions/6006618/) and [How to Draw Box,Rectangle in a C# Console application](https://stackoverflow.com/questions/3858904/) and [How to draw a line in c# console app without using any pre defined methods](https://stackoverflow.com/questions/55061410/) –  Aug 20 '21 at 07:00
  • Using the ASCII art, thanksou – Lê Trần Nam Khánh Aug 22 '21 at 08:51

0 Answers0