Change angle from one value to another in the loop

I want to change angle of the object from value 25.0f to value 25.0f in infinite loop.
How can I do it? My code doesn’t work…

public float maxAngle;
public float minAngle;

void Start()
{
    maxAngle = 25.0f;
    maxAngle = 25.0f;
}

void Update ()
{
    ChangeObjectAngle();
}

private void ChangeObjectAngle()
{
    if(transform.rotation.x <= maxAngle)
        transform.rotation = Quaternion.Euler(maxAngle, 0, 0);
    else
        transform.rotation = Quaternion.Euler(minAngle, 0, 0);
}

And i need to do it smoothly

void Start()
{
maxAngle = 25.0f;
maxAngle = 25.0f;
}

You assign the same value to the same variable twice.
Did you mean to write minAngle = -25.0f?

 void Start()
 {
     maxAngle = 25.0f;
     minAngle = -25.0f;
 }

If you want to smoothly change between 25 and -25 check out Mathf.Lerp().