This blog article shows you the result of the Generative AI generating a simple math equation 3b = 6. I typed the following in GitHub Copilot.
Write a function for equation 2b = 6.
Below is what GitHub Copilot returned.
I typed the following prompt in Gemini.
Write a function for equation 2b = 6 in C#.
Below is what Gemini returned. Don’t be surprised, it is not even a function, although the code is with C# syntax.
I typed the following prompt in ChatGPT.
Write a function for equation 2b = 6 in C#.
Below is what ChatGPT returned.
I typed the following prompt in ChatGPT. Bing Chat
Write a function for equation 2b = 6 in C#.
Below is what Bing Chat returned.
For this, kind of obvious, the code generated by Bing Chat below is more computer science in the sense.
Also: Learn Python Programming with Bing Chat
using System;
namespace EquationSolver
{
class Program
{
static void Main(string[] args)
{
// Example usage: Solve 2b = 6
double b = SolveEquation(2, 6);
Console.WriteLine($”The value of b is: {b}”);
}
static double SolveEquation(double coefficient, double constant)
{
// Solve for b: 2b = 6
// Divide both sides by 2
double b = constant / coefficient;
return b;
}
}
}
Source code download: https://github.com/chanmmn/general/tree/master/2024/fuctioncs/?WT.mc_id=DP-MVP-36769 (this code can run using VS Code)
Reference: https://www.microsoft.com/en-us/edge/features/bing-chat?form=MA13FJ/?WT.mc_id=DP-MVP-36769
Pingback: Find the Common Number for the Numerator and the Denominator | Chanmingman's Blog
Pingback: Extract Date Number from Date | Chanmingman's Blog
Pingback: Add GitHub Copilot to Visual Studio | Chanmingman's Blog