How to rotate a servo motor on a specific angle?
The kind people who have written the Arduino libraries include software drivers for servo control.  These drivers abstract the hardware from the programmer of the sketch software (the sketch is application software you write in C or C++).  It is unnecessary to understand the driver in detail.  However the servo driver software (likely written in C++) can been examined here.

To move a normal servo to a particular position, make a call to the Arduino Servo Driver using the function write(angle) passing an angle value from 0 to 180.  The value is an approximation of degrees and the value type is of type integer.

In the above links you will find this example of sweeping the servo motor across its range:

/* Sweep
 by BARRAGAN &lt;http://barraganstudio.com&gt;
 This example code is in the public domain.

 modified 8 Nov 2013
 by Scott Fitzgerald
 http://www.arduino.cc/en/Tutorial/Sweep
*/

#include &lt;Servo.h&gt;

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position

void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  for (pos = 0; pos &lt;= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos &gt;= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}


Proceed to that page for more details including a schmatic (diagram) of how the servo is connected to an Arduino Uno board.