How to print number of lines with awk ?

Can some body tell me how to print number of line from a particular file, with sed. ?

Input file format

AAAA
BBBB
CCCC
SDFFF
DDDD
DDDD

Command to print line 2 and 3 ?

BBBB
CCCC

And also please tell me how to assign column sum to variable.

I user the following command it only give the sum of the column to screen.

awk '{ x += $5 } END { print x }' file_name

How to assign the x to variable to use in later?

Thanking you,
Regards,
Mahesh Fernando

sed -n '2,3p' file1

x=$(awk '{ x += $5 } END { print x }' file_name)