Pairwise swap elements of a given linked list by changing links
It's weird that you picked append as your primitive for building test cases, when prepend would be so much simpler and faster — O(1) instead of O(n).



auto newNode = new Node{data, nullptr};


This is a very "modern" way of writing what would be more idiomatically written as

Node *newNode = new Node(data, nullptr);


I would weakly recommend the latter. And I would strongly recommend, if you do nothing else, at least calling out explicitly when you're working with raw (non-owning) pointers:

auto *newNode = new Node{data, nullptr};  // the asterisk means watch out!




auto temp{head};


Again, I'd write simply

Node *temp = head;


or at least

auto *temp = head;


The * signals the reader to watch out for pointer pitfalls (aliasing, memory leaks); the = signals the reader that an initialization is happening here. You might be surprised how easy it is to glance over auto temp{head}; surrounded by other lines of code and not even recognize that it's introducing the name temp!



//  pairwise swap of the elements in the given linked lists
void pairwiseSwap(Node **head_ref) {


Some coding guidelines tell you to pass the inout parameter head_ref by pointer here, instead of by reference. I'm going to assume you're following one of those guidelines.



return ;


is an unidiomatic whitespace style; most programmers would write

return;


You actually put an extra space before a lot of semicolons in this function (but not consistently). Are you French? ;)



You should definitely factor out the "swap two nodes" functionality into a named function. I somewhat suspect that this would do, but you'd have to draw it out on paper...

void swap_two_nodes(Node *&amp;p, Node *&amp;q) {
    assert(p-&gt;next == q);
    std::swap(p, q);
}


Alternatively — and since I've confused myself ;) — you could just write a recursive version of the whole thing:

Node *pairwise_swap(Node *head) {
    if (head &amp;&amp; head-&gt;next) {
        Node *first = head-&gt;next;
        Node *second = head;
        Node *tail = pairwise_swap(head-&gt;next-&gt;next);
        head = first;
        first-&gt;next = second;
        second-&gt;next = tail;
    }
    return head;
}


Turning this into tail-recursion is left as an (easy) exercise for the reader.



// for even number of nodes
a = append(a, 15); 


Appending an even number of nodes to an odd-length list does not result in an even-length list. Did you try running your test code? Did you look at the output and verify that it was correct? You should have!