I can draw rectangle using pen tool. Is there any way to draw a hypotenuse while drawing rectangle without manually doing it using line tool?
Without completely understanding why you want to do this, here is how you might do it. (Using Adobe Illustrator.)
Command/Ctrl(Mac/PC) and reposition the last two points over the top of the points they are near. Result: