Query Code Containing Issue

Hi, I am a game developer and I am here to ask a query code containing an issue. I am working on android game & searching for helpful android developer forum. I have searched a lot of forums but issue remains the same. I hope any tech developer can help me over here in resolving the issue.

using UnityEngine;
using System.Collections;

public class Exam : MonoBehaviour {
void Start () {
transform.position.x = 10;
}
}

transform.position is a property returning a Vector3, which is a struct. As with structs, that get passed by value, not reference, you need to get the value, change it and most importantly, assign it back.

using UnityEngine;
using System.Collections;

public class Exam : MonoBehaviour {
void Start () {
Vector3 newPosition = transform.position;
newPosition.x = 10;
transform.position = newPosition;
}
}