Q4 part 1 int bitrev(int x) { int size = 8*sizeof(int); unsigned int mm = 1<<(size-1), lm = 1; ans = 0; for (i = 0; i < size; i += 1) { if (x & lm) ans |= mm; mm >>= 1; lm <<= 1; } return ans; } not quite the way: temp = 0; mask = 1; for (i = 0; i < size; i += 1) { int bit = x & mask; temp = temp + bit; temp <<= 1; x >> = 1; } Q4 part b on the board. Q6 #!/bin/tcsh # this file is named del set filename = $argv[1] shift argv foreach dir ( $argv ) set f = $dir/$filename if ( -f $f ) then rm $f if ( $status ) echo "could not delete "$f else if ( -d $f ) then del $filename $f endif end #!/bin/tcsh # this file is named del set filename = $argv[1] shift argv foreach dir ( $argv ) foreach file ( $dir ) if (-f $file) then if ($file == $filename) then rm $dir/$file endif endif end end #ifndef ssss