Tutorial for Keypad and LCD to Arduino MEGA

I don't understand what you mean. You don't connect the LCD and Keypad together. You connect both to the Mega. There are plenty of pins available. Just change the pins to the ones that you use.