In B4Coder you build a program from flowchart blocks, run it step by step, then press View Code to see it as C#. Change the flowchart and the C# changes with it.
C# is used for Windows apps, websites and games made with Unity. Like Java, every value has a type; B4Coder works them out from your blocks and writes a program that runs on .NET 6 or later.
About the code B4Coder writes: .NET 6 or later. Each value's type (int, double, string) is worked out from your blocks.
The most common blocks, and the C# they turn into. View Code uses your own names and values.
age = int.Parse(Console.ReadLine());
Console.WriteLine("Hello, " + name);int total = 0;
if (age >= 18)
{
...
}
else
{
...
}for (int i = 0; i < 10; i++)
{
...
}while (total < 100)
{
...
}Each one is a flowchart in B4Coder. This is the C# it turns into, exactly as View Code writes it.
Ask for two numbers and show the sum.
using System;
class Program{ static void Main() { double a = 0; double b = 0; double sum = 0;
Console.Write("What is the first number? "); a = double.Parse(Console.ReadLine()); Console.Write("What is the second number? "); b = double.Parse(Console.ReadLine()); sum = a + b; Console.WriteLine("The sum is " + sum); }}Check whether a number is even or odd.
using System;
class Program{ static void Main() { int number = 0;
Console.Write("Enter a number "); number = int.Parse(Console.ReadLine()); if (number % 2 == 0) { Console.WriteLine("It is an Even number"); } else { Console.WriteLine("It is an Odd number"); } }}Use a repeat loop to count from 1 to 10.
using System;
class Program{ static void Main() { int count = 0;
count = 1; for (int i0 = 0, n0 = 10; i0 < n0; i0++) { Console.WriteLine("Count: " + count); count = count + 1; } }}Build a flowchart, press Run to watch it work, then open View Code and pick C#. It's free, with no install.
Open the editor