Complete the code to declare a value type variable.
int [1] = 10;
The variable number is a simple value type variable of type int.
Complete the code to copy the value of one variable to another.
int a = 5; int b = [1];
Assigning b = a copies the value of a into b.
Fix the error in copying a struct value.
struct Point { public int X; public int Y; }
Point p1 = new Point { X = 1, Y = 2 };
Point p2 = [1];
p2.X = 5;Assigning p2 = p1 copies the struct value. Using &p1 or ref p1 is invalid here.
Fill both blanks to create a copy of a struct and modify it without changing the original.
struct Rectangle { public int Width; public int Height; }
Rectangle rect1 = new Rectangle { Width = 10, Height = 20 };
Rectangle rect2 = [1];
rect2.Width = [2];Assigning rect2 = rect1 copies the value. Changing rect2.Width to 15 does not affect rect1.
Fill all three blanks to demonstrate that changing a copied value type does not affect the original.
struct Circle { public int Radius; }
Circle c1 = new Circle { Radius = 7 };
Circle c2 = [1];
c2.Radius = [2];
Console.WriteLine(c1.Radius == [3]);Assigning c2 = c1 copies the value. Changing c2.Radius to 10 does not change c1.Radius, which remains 7.
