Generate Code using GitHub Copilot, Gemini, ChatGPT, and Bing Chat

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

About chanmingman

Since March 2011 Microsoft Live Spaces migrated to Wordpress (http://www.pcworld.com/article/206455/Microsoft_Live_Spaces_Moves_to_WordPress_An_FAQ.html) till now, I have is over 1 million viewers. This blog is about more than 50% telling you how to resolve error messages, especial for Microsoft products. The blog also has a lot of guidance teaching you how to get stated certain Microsoft technologies. The blog also uses as a help to keep my memory. The blog is never meant to give people consulting services or silver bullet solutions. It is a contribution to the community. Thanks for your support over the years. Ming Man is Microsoft MVP since year 2006. He is a software development manager for a multinational company. With 25 years of experience in the IT field, he has developed system using Clipper, COBOL, VB5, VB6, VB.NET, Java and C #. He has been using Visual Studio (.NET) since the Beta back in year 2000. He and the team have developed many projects using .NET platform such as SCM, and HR based applications. He is familiar with the N-Tier design of business application and is also an expert with database experience in MS SQL, Oracle and AS 400.
This entry was posted in .Net, Cloud, Community, Computers and Internet, programming and tagged . Bookmark the permalink.

3 Responses to Generate Code using GitHub Copilot, Gemini, ChatGPT, and Bing Chat

  1. Pingback: Find the Common Number for the Numerator and the Denominator | Chanmingman's Blog

  2. Pingback: Extract Date Number from Date | Chanmingman's Blog

  3. Pingback: Add GitHub Copilot to Visual Studio | Chanmingman's Blog

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.