Converting JS to C#

How would I convert the following code from JS to C#?

var target : Camera;

function Update() {

var n = target.transform.position - transform.position; 
transform.rotation = Quaternion.LookRotation(n) * Quaternion.Euler(0, 0, 0); 
transform.eulerAngles.z = 0;

}

Not sure am I correct or wrong

Camera target;

void Update() {

 Vector3 n = target.transform.position - transform.position; 
 transform.rotation = Quaternion.LookRotation(n) * Quaternion.Euler(0, 0, 0); 
 transform.eulerAngles.z = 0;
}