Doubt on Arduino MEGA programming on getting an 8-bits input

Hi… Can any one please help me OuT!!!
I am new to the Arduino & I Was struck with a project, where I need to use 8-bit binary values.
I can get 8-single bit binary output from the machine(1-from pin1, 0-from pin-2,…….), but I need to combine those into a single 8-bit binary output(e.g. 1011 0100).
These might be simple but that helps me alot.....

edit my mod: title switched to lowercase

bitWrite ?

Please don't SHOUT.

int myByte = 0;
myByte =digitalRead(Pin1); //most significant (right hand) bit, 1 or 0
myByte = myByte *2 +digitalRead(Pin2); //shift left and add 1 or 0 from pin2
myByte = myByte *2 +digitalRead(Pin3); //etc
myByte = myByte *2 +digitalRead(Pin4);
myByte = myByte *2 +digitalRead(Pin5);
myByte = myByte *2 +digitalRead(Pin6);
myByte = myByte *2 +digitalRead(Pin7);
myByte = myByte *2 +digitalRead(Pin8);// least significant (left hand) bit

Your title says “input” but your post says “output”.

Which is it?

What is the input or output for?

…R