Remove all subtrees consisting only of even valued nodes from a Binary Tree

#include
using namespace std;
  

struct node {
    int data;
    struct node *left, *right;
};
  

node* newNode(int key)
{
    node* temp = new node;
    temp->data = key;
    temp->left = temp->right = NULL;
    return (temp);
}
  

void printLevelOrder(node* root)
{
    
    if (!root)
        return;
  
    
    
    queue q;
  
    
    q.push(root);
  
    while (!q.empty()) {
  
        
        
        node* temp = q.front();
        cout data left != NULL) {
  
            q.push(temp->left);
        }
  
        
        else if (temp->right != NULL) {
  
            cout right != NULL) {
  
            q.push(temp->right);
        }
  
        
        else if (temp->left != NULL) {
  
            cout left = pruneTree(root->left);
    root->right = pruneTree(root->right);
  
    
    
    if (root->data % 2 == 0
        && !root->right
        && !root->left)
        return NULL;
  
    return root;
}
  

int main()
{
    struct node* root = newNode(1);
    root->left = newNode(2);
    root->left->left = newNode(8);
    root->left->right = newNode(10);
    root->right = newNode(7);
    root->right->left = newNode(12);
    root->right->right = newNode(5);
  
    
    node* newRoot = pruneTree(root);
  
    
    printLevelOrder(newRoot);
  
    return 0;
}