Write a program in C# Sharp to declare a simple structure and use of static fields inside a structure
- برمجة سي شارب
- برمجة
- 2021-05-31
- ahmadghneem
الأجوبة
using System;
struct ahgStruct
{
public static int x = 15;
public static int y = 25;
}
class strucExer2
{
public static void Main()
{
Console.Write("\n\nStructure with the use of static fields inside a structure :\n");
Console.Write("-------------------------------------------------------------\n");
int sum =ahgStruct.x + ahgStruct.y;
Console.WriteLine("The sum of x and y is {0}\n",sum);
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال