You have not finished coding. Technically, if you have finished whatever you have done bug free, your output would have
List is not empty!!
4
Let's focus at your
createNode function
void LinkedList::createNode(int value){
node *temp = new node;
temp->data = value;
temp->next = nullptr;
if(head == nullptr){
head = temp;
delete temp;
temp = nullptr;
} else {
cout << "List is not empty!!" << endl;
}
};