text: C # program for the above approach
code: using System ; class GFG { class pair { public float first , second ; public pair ( float first , float second ) { this . first = first ; this . second = second ; } }