if user is admin display admin link and logout link else display logout only

You’ve got some serious syntax errors – once you open that <?php tag, you’re running PHP – no need to execute it again (i.e. inside your variable assignment strings):

if ( is_user_logged_in() ) { // Only show the output below if a user is logged in

    $admin_link  = esc_url( admin_url() ); // Escaped admin link
    $logout_link = esc_url( wp_logout_url() ); // Escaped logout link

    if ( current_user_can( 'manage_options' ) ) { // Current user is an admin, show the admin link
        echo ' &middot; <a href="' . $admin_link . '">Admin</a> &middot;';
    }

    echo ' &middot; <a href="' . $logout_link . '">Log out</a> &middot;';
}

tech