How to create a 2D point data structure with two floating-point numbers in C#

1 Answer

0 votes
using System;

class Program
{
    struct Point {
        public double x;
        public double y;
    };
    
    static void Main() {
        Point p;
        
        p.x = 2.36;
        p.y = 1.94;

        Console.Write(p.x + " " + p.y);
    }
}




/*
run:

2.36 1.94

*/

 



answered Dec 26, 2022 by avibootz
...